Class: JSON::Stream::ArrayNode
- Inherits:
-
Object
- Object
- JSON::Stream::ArrayNode
- Defined in:
- lib/json/stream/builder.rb
Instance Attribute Summary collapse
-
#obj ⇒ Object
readonly
Returns the value of attribute obj.
Instance Method Summary collapse
- #<<(node) ⇒ Object
-
#initialize ⇒ ArrayNode
constructor
A new instance of ArrayNode.
- #to_s ⇒ Object
Constructor Details
#initialize ⇒ ArrayNode
Returns a new instance of ArrayNode.
63 64 65 |
# File 'lib/json/stream/builder.rb', line 63 def initialize @obj = [] end |
Instance Attribute Details
#obj ⇒ Object (readonly)
Returns the value of attribute obj.
61 62 63 |
# File 'lib/json/stream/builder.rb', line 61 def obj @obj end |
Instance Method Details
#<<(node) ⇒ Object
67 68 69 70 |
# File 'lib/json/stream/builder.rb', line 67 def <<(node) @obj << node self end |
#to_s ⇒ Object
72 73 74 |
# File 'lib/json/stream/builder.rb', line 72 def to_s obj.inspect end |