Reference
Come here to look something up. A page takes one topic and covers all of it: options in a table, an example CI runs for each behaviour, and for each error what raises it. Nothing here teaches. New to the gems? The tutorial comes first, and the explanation pages give the reasons behind the design.
Versions covered
Section titled “Versions covered”These pages describe field_struct 1.0.0.pre1 and actionable-rb 2.0.0.pre1. The block below is a checked example too, so the build fails if the versions named here drift from the code.
FieldStruct::VERSION # => '1.0.0.pre1'Actionable::VERSION # => '2.0.0.pre1'If a page and the code disagree, the code wins and the page has a bug. Where a spec leaves a question open, the page says that and doesn’t guess.
field_struct
Section titled “field_struct”Typed plain-Ruby objects. The pages go from declaring a field to the exceptions the gem raises.
- Fields and options -
field,required,optionaland the options every type shares - Types - every built-in type and what it coerces
- Dates, times and zones - parsing,
format:presets,zone: - Validation and errors - the setter pipeline, messages, the
ErrorsAPI - Class macros -
coercion_policy,unknown_attributes,immutable!,validate,serialize - Instance API - building, reading, copying and comparing instances
- JSON and serialization -
to_json,from_json, key mappings - Registries and custom types - name resolution and writing a type
- Introspection and tooling -
Metadata,describe, RBS, scaffolding - Exceptions - every error class and what raises it
actionable
Section titled “actionable”Service objects with declared inputs, steps and outcomes.
- Actions and steps -
.run, the step DSL, guards, nesting - Control flow -
succeed,fail,skipandhalt! - Results -
Success,FailureandSkipped - Input and output - typed
inputandoutput - Declared failures, skips and typed outcomes -
fails,skips,typed_outcomes - Hooks and history -
on_success,always, the run history - Batches and introspection -
run_each,describe, the registry - Background jobs - retry and discard by failure code
- Rails adapter -
transactionalandafter_commit - Testing - matchers, result builders, stubs
- RuboCop cop -
Actionable/VerbNotLast - RBS for your actions - generated signatures
- Errors and guardrails - exception classes and the checks that raise them
Outside this section
Section titled “Outside this section”Both gems keep a short README in the repository that links back here: field_struct and actionable. The optional format adapters have their own pages under Adapters, and each is a prerelease too.
FieldStruct, Actionable and their adapters are open source under the MIT license.