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.
351 352 353 |
# File 'lib/axn/core/contract.rb', line 351 def initialize @declarations = [] end |
Instance Attribute Details
#declarations ⇒ Object (readonly)
Returns the value of attribute declarations.
349 350 351 |
# File 'lib/axn/core/contract.rb', line 349 def declarations @declarations end |
Instance Method Details
#field(name, **opts, &block) ⇒ Object
355 356 357 |
# File 'lib/axn/core/contract.rb', line 355 def field(name, **opts, &block) @declarations << [name, opts, block] end |