Class: Symbol

Inherits:
Object
  • Object
show all
Defined in:
lib/fancy_to_proc.rb

Instance Method Summary collapse

Instance Method Details

#&(other) ⇒ Object



15
16
17
# File 'lib/fancy_to_proc.rb', line 15

def &(other)
  proc { |*args| other.to_proc.call to_proc.call(*args) }
end

#call(*defaults) ⇒ Object



19
20
21
# File 'lib/fancy_to_proc.rb', line 19

def call(*defaults)
  proc { |*args| args.shift.__send__(self, *defaults) }
end

#|(other) ⇒ Object



11
12
13
# File 'lib/fancy_to_proc.rb', line 11

def |(other)
  proc { |*args| args.shift.__send__(self, other) }
end

#~Object



7
8
9
# File 'lib/fancy_to_proc.rb', line 7

def ~
  method(self).to_proc
end