class ApMethod
Public Class Methods
new(methods)
click to toggle source
# File lib/method_missing/ap_method.rb, line 4 def initialize(methods) @methods = methods end
Public Instance Methods
*(f)
click to toggle source
# File lib/method_missing/ap_method.rb, line 8 def *(f) ApMethod.new(@methods.map {|m| ConsMethod.new(m, f)}) end
/(f)
click to toggle source
# File lib/method_missing/ap_method.rb, line 12 def /(f) ApMethod.new(@methods + [f]) end
[](*x)
click to toggle source
# File lib/method_missing/ap_method.rb, line 39 def [](*x) call(*x) end
^(power)
click to toggle source
# File lib/method_missing/ap_method.rb, line 16 def ^(power) ApMethod.new(@methods.map {|m| m ^ power}) end
arity()
click to toggle source
# File lib/method_missing/ap_method.rb, line 35 def arity @methods.first.arity end
call(*x)
click to toggle source
# File lib/method_missing/ap_method.rb, line 21 def call(*x) @methods.map{|m| m.call(*x)} end
inspect()
click to toggle source
# File lib/method_missing/ap_method.rb, line 31 def inspect "#<ApMethod: #{@methods.map{|m| m.inspect}.join(' / ')}>" end
to_proc()
click to toggle source
# File lib/method_missing/ap_method.rb, line 25 def to_proc lambda {|*x| @methods.map {|m| m.call(*x) } } end