Module: MPatch::Include::Proc
- Defined in:
- lib/mpatch/proc.rb
Instance Method Summary collapse
-
#*(other) ⇒ Object
sugar syntax for proc * operator a = ->(x)x+1 b = ->(x)x*10 c = b*a c.call(1) #=> 20.
Instance Method Details
#*(other) ⇒ Object
sugar syntax for proc * operator
a = ->(x){x+1}
b = ->(x){x*10}
c = b*a
c.call(1) #=> 20
12 13 14 |
# File 'lib/mpatch/proc.rb', line 12 def *(other) self.class.new { |*args| self[*other[*args]] } end |