Class Symbol
In: lib/prelude.rb
Parent: Object

Methods

**   -@   curry   to_proc  

Public Instance methods

This is will serve as an infix composition operator for symbols. If between two symbols, returns composition proc, executes left symbol otherwise.

[Source]

    # File lib/prelude.rb, line 77
77:   def **(*args)
78:     if (1==args.length) && args[0].is_a?(Symbol)
79:       proc {|*a| self.to_proc.call(args[0].call(*a)) }
80:     else
81:       self.to_proc.call(*args.flatten)
82:     end
83:   end
-@()

Alias for to_proc

FIXIT

[Source]

    # File lib/prelude.rb, line 71
71:   def curry(one, *args)
72:     proc { |*args| self.to_proc.call(one, *args) }
73:   end

Converts a symbol to a proc object

[Source]

    # File lib/prelude.rb, line 63
63:   def to_proc
64:     proc { |obj, *args| obj.send(self, *args) }
65:   end