class Mingle::MingleNumber

Attributes

num[R]

Public Class Methods

new( num, convert_meth = nil ) click to toggle source
# File lib/mingle.rb, line 140
def initialize( num, convert_meth = nil )
    
    not_nil( num, :num )
    @num = convert_meth ? num.send( convert_meth ) : num
end

Public Instance Methods

<=>( other ) click to toggle source
# File lib/mingle.rb, line 165
def <=>( other )
    
    if other.is_a?( MingleNumber )
        @num <=> other.num
    else
        raise TypeError, other.class.to_s
    end
end
==( other ) click to toggle source
# File lib/mingle.rb, line 157
def ==( other )
    other.class == self.class && other.num == @num
end
Also aliased as: eql?
eql?( other )
Alias for: ==
inspect() click to toggle source
# File lib/mingle.rb, line 152
def inspect
    to_s.inspect
end
to_f() click to toggle source
# File lib/mingle.rb, line 180
def to_f
    @num.to_f
end
to_i() click to toggle source
# File lib/mingle.rb, line 175
def to_i
    @num.to_i
end
to_s() click to toggle source
# File lib/mingle.rb, line 147
def to_s
    @num.to_s
end