lib/gloo/expr/l_integer.rb in gloo-0.6.1 vs lib/gloo/expr/l_integer.rb in gloo-0.7.0
- old
+ new
@@ -6,22 +6,29 @@
module Gloo
module Expr
class LInteger < Gloo::Core::Literal
+ #
# Is the given token an integer?
+ #
def self.integer?( token )
return true if token.is_a? Integer
s = token.strip
return s.to_i.to_s == s
end
+ #
# Set the value, converting to an integer.
+ #
def set_value( value )
@value = value.to_i
end
+ #
+ # Get string representation
+ #
def to_s
return self.value.to_s
end
end