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.



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

def initialize(value)
  @value = value
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



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

def value
  @value
end

Instance Method Details

#eval(context) ⇒ Object



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

def eval(context)
  value.to_s
end