Class: Optimus::ParsedCalculator::StringLiteral

Inherits:
Expr
  • Object
show all
Defined in:
lib/expression_parser/expressions.rb

Constant Summary

Constants inherited from Expr

Expr::BINARY_OPERATORS

Instance Method Summary collapse

Methods inherited from Expr

#-@, #eq, #logical_and, #logical_not, #logical_or, #neq, #to_bool

Constructor Details

#initialize(token) ⇒ StringLiteral

Returns a new instance of StringLiteral.



118
119
120
# File 'lib/expression_parser/expressions.rb', line 118

def initialize(token)
  @token = token
end

Instance Method Details

#evaluate(*args) ⇒ Object



126
127
128
# File 'lib/expression_parser/expressions.rb', line 126

def evaluate(*args)
  @token
end

#to_sObject



122
123
124
# File 'lib/expression_parser/expressions.rb', line 122

def to_s
  "'#{@token}'"
end