Sha256: 5c407421065d85fc906708a68b3e8413d18939cb4c837ed8d8db304d015e586d
Contents?: true
Size: 736 Bytes
Versions: 29
Compression:
Stored size: 736 Bytes
Contents
# Author:: Eric Crane (mailto:eric.crane@mac.com) # Copyright:: Copyright (c) 2020 Eric Crane. All rights reserved. # # A literal decimal value. # module GlooLang module Expr class LDecimal < GlooLang::Core::Literal # # Is the given token a decimal? # def self.decimal?( token ) return true if token.is_a? Numeric s = token.strip return s.to_f.to_s == s end # # Set the value, converting to an integer. # def set_value( value ) value = value.to_s if value.is_a? Numeric @value = value.to_f end # # Get string representation # def to_s return self.value.to_s end end end end
Version data entries
29 entries across 29 versions & 1 rubygems