Class: Poetics::Syntax::Number

Inherits:
Value show all
Defined in:
lib/poetics/syntax/literal.rb

Instance Attribute Summary collapse

Attributes inherited from Node

#column, #line

Instance Method Summary collapse

Methods inherited from Value

#to_sexp

Methods inherited from Node

#to_sexp

Constructor Details

#initialize(line, column, value) ⇒ Number

Returns a new instance of Number.



12
13
14
15
# File 'lib/poetics/syntax/literal.rb', line 12

def initialize(line, column, value)
  super
  @value = value.to_f
end

Instance Attribute Details

#valueObject

Returns the value of attribute value.



10
11
12
# File 'lib/poetics/syntax/literal.rb', line 10

def value
  @value
end

Instance Method Details

#sexp_nameObject



17
18
19
# File 'lib/poetics/syntax/literal.rb', line 17

def sexp_name
  :number
end