Class: JSON::Stream::ArrayNode

Inherits:
Object
  • Object
show all
Defined in:
lib/json/stream/builder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeArrayNode

Returns a new instance of ArrayNode.



63
64
65
# File 'lib/json/stream/builder.rb', line 63

def initialize
  @obj = []
end

Instance Attribute Details

#objObject (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_sObject



72
73
74
# File 'lib/json/stream/builder.rb', line 72

def to_s
  obj.inspect
end