Class: Luoma::FloatLiteral

Inherits:
Expression show all
Defined in:
lib/luoma/expression.rb,
sig/luoma/expression.rbs

Instance Attribute Summary collapse

Attributes inherited from Expression

#span, #token

Instance Method Summary collapse

Methods inherited from Expression

#scope

Constructor Details

#initialize(token, value) ⇒ FloatLiteral

(t_token, Float)

Parameters:

  • token (t_token)
  • value (Float)


815
816
817
818
# File 'lib/luoma/expression.rb', line 815

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

Instance Attribute Details

#valueFloat (readonly)

Returns the value of attribute value.

Returns:

  • (Float)


812
813
814
# File 'lib/luoma/expression.rb', line 812

def value
  @value
end

Instance Method Details

#children::Array[_Traversable]

() -> Array

Returns:



268
269
270
# File 'sig/luoma/expression.rbs', line 268

def children
  []
end

#evaluate(context) ⇒ Object

(RenderContext) -> untyped

Parameters:

Returns:

  • (Object)


821
822
823
# File 'lib/luoma/expression.rb', line 821

def evaluate(context)
  @value
end

#to_sString

() -> String

Returns:

  • (String)


830
831
832
# File 'lib/luoma/expression.rb', line 830

def to_s
  @value.to_s
end