9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
# File 'lib/funcionalist/point_free/operator.rb', line 9
def self.caculate(left, right)
reciever, value = left
method_and_args, block = right
puts "#{reciever.inspect} >> ##{method_and_args}"
a = case method_and_args.first
when :funcionalist_point_free_change_reciever
[method_and_args[1],reciever]
else
method_and_args = [method_and_args[0]] + [value] if value
[reciever.send(*method_and_args, &block), nil]
end
puts a.inspect ;puts
return a
end
|