Class: JSE::Ast::QuoteNode
Instance Attribute Summary
Attributes inherited from AstNode
Instance Method Summary collapse
- #apply(_call_env) ⇒ Object
-
#initialize(value, env) ⇒ QuoteNode
constructor
A new instance of QuoteNode.
- #to_json ⇒ Object
Constructor Details
#initialize(value, env) ⇒ QuoteNode
Returns a new instance of QuoteNode.
162 163 164 165 |
# File 'lib/jse/ast/nodes.rb', line 162 def initialize(value, env) super(env) @value = value end |
Instance Method Details
#apply(_call_env) ⇒ Object
167 168 169 |
# File 'lib/jse/ast/nodes.rb', line 167 def apply(_call_env) @value end |
#to_json ⇒ Object
171 172 173 174 175 176 177 |
# File 'lib/jse/ast/nodes.rb', line 171 def to_json if @value.respond_to?(:to_json) ["$quote", @value.to_json] else ["$quote", @value] end end |