Class: Rjq::AST::Literal

Inherits:
Node
  • Object
show all
Defined in:
lib/rjq/ast.rb

Instance Attribute Summary collapse

Attributes inherited from Node

#source_span

Instance Method Summary collapse

Methods inherited from Node

#assign_value, #invalid_path_message, #paths, #take, #with_source_span

Constructor Details

#initialize(value) ⇒ Literal

Returns a new instance of Literal.



200
201
202
# File 'lib/rjq/ast.rb', line 200

def initialize(value)
  @value = value
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



198
199
200
# File 'lib/rjq/ast.rb', line 198

def value
  @value
end

Instance Method Details

#eval(_input, _context) ⇒ Object



204
205
206
# File 'lib/rjq/ast.rb', line 204

def eval(_input, _context)
  [Value.deep_copy(value)]
end