Class: Jsonerino::JsonArray

Inherits:
JsonValue show all
Defined in:
lib/jsonerino/ast.rb

Instance Attribute Summary collapse

Attributes inherited from JsonValue

#finish, #start

Instance Method Summary collapse

Constructor Details

#initializeJsonArray

Returns a new instance of JsonArray.



51
52
53
# File 'lib/jsonerino/ast.rb', line 51

def initialize()
  @value = []
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



49
50
51
# File 'lib/jsonerino/ast.rb', line 49

def value
  @value
end

Instance Method Details

#push(value) ⇒ Object



55
56
57
58
59
# File 'lib/jsonerino/ast.rb', line 55

def push(value)
  raise 'Value is not instnace of JsonValue' unless value.is_a? JsonValue

  @value.push(value)
end

#resolveObject



61
62
63
# File 'lib/jsonerino/ast.rb', line 61

def resolve
  @value.map(&:resolve)
end