Class: Kalc::Ast::StringValue

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ StringValue

Returns a new instance of StringValue.



228
229
230
# File 'lib/kalc/ast.rb', line 228

def initialize(value)
  @value = value
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



226
227
228
# File 'lib/kalc/ast.rb', line 226

def value
  @value
end

Instance Method Details

#eval(context) ⇒ Object



232
233
234
# File 'lib/kalc/ast.rb', line 232

def eval(context)
  value.to_s
end