Class: Axn::Core::Contract::ShapeBuilder
- Inherits:
-
Object
- Object
- Axn::Core::Contract::ShapeBuilder
- Defined in:
- lib/axn/core/contract.rb
Overview
Collector for the ‘field …` calls inside a structured field’s block.
Instance Attribute Summary collapse
-
#declarations ⇒ Object
readonly
Returns the value of attribute declarations.
Instance Method Summary collapse
- #field(name, **opts, &block) ⇒ Object
-
#initialize ⇒ ShapeBuilder
constructor
A new instance of ShapeBuilder.
Constructor Details
#initialize ⇒ ShapeBuilder
Returns a new instance of ShapeBuilder.
37 38 39 |
# File 'lib/axn/core/contract.rb', line 37 def initialize @declarations = [] end |
Instance Attribute Details
#declarations ⇒ Object (readonly)
Returns the value of attribute declarations.
35 36 37 |
# File 'lib/axn/core/contract.rb', line 35 def declarations @declarations end |
Instance Method Details
#field(name, **opts, &block) ⇒ Object
41 42 43 |
# File 'lib/axn/core/contract.rb', line 41 def field(name, **opts, &block) @declarations << [name, opts, block] end |