module PatternMatching::ProcHelpers
Public Instance Methods
C(symbol)
click to toggle source
C
for 'call', as in “call method in current context”. Allows for prettier Method pattern-matches than method(:sym)
# File lib/pattern_matching/proc_helpers.rb, line 14 def C(symbol) Proc.new { |obj| self.send(symbol, obj) } end
S(symbol)
click to toggle source
S
for 'send', as in “send message to object”. Allows for prettier Proc pattern-matches than simply :sym.to_proc everywhere
# File lib/pattern_matching/proc_helpers.rb, line 7 def S(symbol) symbol.to_proc end