Class: JSE::Ast::ObjectNode
Instance Attribute Summary
Attributes inherited from AstNode
Instance Method Summary collapse
- #apply(call_env) ⇒ Object
-
#initialize(dict, env) ⇒ ObjectNode
constructor
A new instance of ObjectNode.
- #to_json ⇒ Object
Constructor Details
#initialize(dict, env) ⇒ ObjectNode
Returns a new instance of ObjectNode.
83 84 85 86 |
# File 'lib/jse/ast/nodes.rb', line 83 def initialize(dict, env) super(env) @dict = dict end |
Instance Method Details
#apply(call_env) ⇒ Object
88 89 90 |
# File 'lib/jse/ast/nodes.rb', line 88 def apply(call_env) @dict.transform_values { |v| call_env.eval(v) } end |
#to_json ⇒ Object
92 93 94 |
# File 'lib/jse/ast/nodes.rb', line 92 def to_json @dict.transform_values(&:to_json) end |