Class: Luoma::IntegerLiteral

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) ⇒ IntegerLiteral

(t_token, Integer)

Parameters:

  • token (t_token)
  • value (Integer)


791
792
793
794
# File 'lib/luoma/expression.rb', line 791

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

Instance Attribute Details

#valueInteger (readonly)

Returns the value of attribute value.

Returns:

  • (Integer)


788
789
790
# File 'lib/luoma/expression.rb', line 788

def value
  @value
end

Instance Method Details

#children::Array[_Traversable]

() -> Array

Returns:



250
251
252
# File 'sig/luoma/expression.rbs', line 250

def children
  []
end

#evaluate(context) ⇒ Object

(RenderContext) -> untyped

Parameters:

Returns:

  • (Object)


797
798
799
# File 'lib/luoma/expression.rb', line 797

def evaluate(context)
  @value
end

#to_sString

() -> String

Returns:

  • (String)


806
807
808
# File 'lib/luoma/expression.rb', line 806

def to_s
  @value.to_s
end