Class: Serial::ArrayBuilder Private
- Defined in:
- lib/serial/array_builder.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Attribute Summary
Attributes inherited from Builder
Instance Method Summary collapse
- #collection(key, &block) ⇒ Object private
- #element(&block) ⇒ Object private
-
#initialize(context) {|_self| ... } ⇒ ArrayBuilder
constructor
private
A new instance of ArrayBuilder.
Methods inherited from Builder
Constructor Details
#initialize(context) {|_self| ... } ⇒ ArrayBuilder
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of ArrayBuilder.
4 5 6 7 8 |
# File 'lib/serial/array_builder.rb', line 4 def initialize(context, &block) @context = context @data = [] yield self end |
Instance Method Details
#collection(key, &block) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
14 15 16 |
# File 'lib/serial/array_builder.rb', line 14 def collection(key, &block) @data << build(ArrayBuilder, &block) end |
#element(&block) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
10 11 12 |
# File 'lib/serial/array_builder.rb', line 10 def element(&block) @data << build(HashBuilder, &block) end |