class Symbol

Public Instance Methods

+(other) click to toggle source
# File lib/rubyhacks.rb, line 103
def +(other)
        if other.class == String
                self.to_s + other
        elsif other.class == Symbol
                (self.to_s+other.to_s).to_sym
        else
                raise NoMethodError
        end
end
-@() click to toggle source
# File lib/rubyhacks.rb, line 120
def -@
    @sign ||= 1
    @sign *= -1
    self
end
=~(other) click to toggle source
# File lib/rubyhacks.rb, line 113
def =~(other)
        return self.to_s =~ other
end
sign() click to toggle source
# File lib/rubyhacks.rb, line 116
def sign
        @sign ||= 1
        @sign
end