Class: ViewComponentReducible::State::DSL::Builder
- Inherits:
-
Object
- Object
- ViewComponentReducible::State::DSL::Builder
- Defined in:
- lib/view_component_reducible/state/dsl.rb
Instance Method Summary collapse
-
#field(name, default:) ⇒ void
Define a state field.
-
#initialize(schema) ⇒ Builder
constructor
A new instance of Builder.
Constructor Details
#initialize(schema) ⇒ Builder
Returns a new instance of Builder.
29 |
# File 'lib/view_component_reducible/state/dsl.rb', line 29 def initialize(schema) = (@schema = schema) |
Instance Method Details
#field(name, default:) ⇒ void
This method returns an undefined value.
Define a state field.
35 36 37 |
# File 'lib/view_component_reducible/state/dsl.rb', line 35 def field(name, default:) @schema.add_field(name, default:) end |