Class: Symbol

Inherits:
Object show all
Includes:
Comparable
Defined in:
lib/backports/1.9/symbol.rb,
lib/backports/1.8.7/symbol.rb

Instance Method Summary collapse

Instance Method Details

#<=>(with) ⇒ Object

Standard in ruby 1.9. See official documentation



14
15
16
17
# File 'lib/backports/1.9/symbol.rb', line 14

def <=>(with)
  return nil unless with.is_a? Symbol
  to_s <=> with.to_s
end

#casecmp(with) ⇒ Object

Standard in ruby 1.9. See official documentation



20
21
22
23
# File 'lib/backports/1.9/symbol.rb', line 20

def casecmp(with)
  return nil unless with.is_a? Symbol
  to_s.casecmp(with.to_s)
end

#to_procObject

Standard in ruby 1.8.7+. See official documentation



3
4
5
# File 'lib/backports/1.8.7/symbol.rb', line 3

def to_proc
  Proc.new { |*args| args.shift.__send__(self, *args) }
end