class Functionalist::PointFree::Expression
Public Class Methods
new()
click to toggle source
# File lib/functionalist/point_free/expression.rb, line 8 def initialize @methods = [] end
Public Instance Methods
method_missing(*method_and_args, &block)
click to toggle source
def _(reciever)
self.functionalist_point_free_change_reciever(reciever)
end
# File lib/functionalist/point_free/expression.rb, line 17 def method_missing(*method_and_args, &block) @methods << [method_and_args, block] unless method_and_args == [:respond_to?, :to_proc] self end
queue()
click to toggle source
# File lib/functionalist/point_free/expression.rb, line 32 def queue @methods end
to_proc()
click to toggle source
# File lib/functionalist/point_free/expression.rb, line 23 def to_proc lambda do |obj| reciever, value = @methods.inject(obj) do |left, right| Functionalist::PointFree::Operator.caculate(left, right) end reciever end end