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.
69 70 71 |
# File 'lib/json/stream/builder.rb', line 69 def initialize @obj = [] end |
Instance Attribute Details
#obj ⇒ Object (readonly)
Returns the value of attribute obj.
67 68 69 |
# File 'lib/json/stream/builder.rb', line 67 def obj @obj end |
Instance Method Details
#<<(node) ⇒ Object
73 74 75 76 |
# File 'lib/json/stream/builder.rb', line 73 def <<(node) @obj << node self end |
#to_s ⇒ Object
78 79 80 |
# File 'lib/json/stream/builder.rb', line 78 def to_s obj.inspect end |