class Funcionalist::PointFree::Expression
Public Class Methods
new()
click to toggle source
# File lib/funcionalist/point_free/expression.rb, line 8 def initialize @methods = [] end
Public Instance Methods
_(reciever)
click to toggle source
# File lib/funcionalist/point_free/expression.rb, line 12 def _(reciever) self.funcionalist_point_free_change_reciever(reciever) end
method_missing(*method_and_args, &block)
click to toggle source
# File lib/funcionalist/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/funcionalist/point_free/expression.rb, line 32 def queue @methods end
to_proc()
click to toggle source
# File lib/funcionalist/point_free/expression.rb, line 23 def to_proc lambda do |obj| reciever, value = @methods.inject(obj) do |left, right| Funcionalist::PointFree::Operator.caculate(left, right) end reciever end end