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.



69
70
71
# File 'lib/json/stream/builder.rb', line 69

def initialize
  @obj = []
end

Instance Attribute Details

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



78
79
80
# File 'lib/json/stream/builder.rb', line 78

def to_s
  obj.inspect
end