Class: Jsonerino::JsonArray
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Attributes inherited from JsonValue
Instance Method Summary collapse
-
#initialize ⇒ JsonArray
constructor
A new instance of JsonArray.
- #push(value) ⇒ Object
- #resolve ⇒ Object
Constructor Details
#initialize ⇒ JsonArray
Returns a new instance of JsonArray.
51 52 53 |
# File 'lib/jsonerino/ast.rb', line 51 def initialize() @value = [] end |
Instance Attribute Details
#value ⇒ Object (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 |
#resolve ⇒ Object
61 62 63 |
# File 'lib/jsonerino/ast.rb', line 61 def resolve @value.map(&:resolve) end |