Class: RLSL::Prism::IR::Literal
- Defined in:
- lib/rlsl/prism/ir/expressions.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Attributes inherited from Node
Instance Method Summary collapse
-
#initialize(value, type = nil) ⇒ Literal
constructor
A new instance of Literal.
Methods inherited from Node
Constructor Details
#initialize(value, type = nil) ⇒ Literal
Returns a new instance of Literal.
47 48 49 50 51 |
# File 'lib/rlsl/prism/ir/expressions.rb', line 47 def initialize(value, type = nil) super() @value = value @type = type || (value.is_a?(Float) ? :float : :int) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
43 44 45 |
# File 'lib/rlsl/prism/ir/expressions.rb', line 43 def value @value end |