Class: JSE::Ast::LiteralNode

Inherits:
AstNode
  • Object
show all
Defined in:
lib/jse/ast/nodes.rb

Instance Attribute Summary collapse

Attributes inherited from AstNode

#env

Instance Method Summary collapse

Constructor Details

#initialize(value, env) ⇒ LiteralNode

Returns a new instance of LiteralNode.



4
5
6
7
# File 'lib/jse/ast/nodes.rb', line 4

def initialize(value, env)
  super(env)
  @value = value
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



9
10
11
# File 'lib/jse/ast/nodes.rb', line 9

def value
  @value
end

Instance Method Details

#apply(_call_env) ⇒ Object



11
12
13
# File 'lib/jse/ast/nodes.rb', line 11

def apply(_call_env)
  @value
end

#to_jsonObject



15
16
17
# File 'lib/jse/ast/nodes.rb', line 15

def to_json
  @value
end