Module: Trick::Function

Defined in:
lib/trick/function.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.extended(base) ⇒ Object

TODO:

`module_function` does not work here, would we use it instead of
`extend`?


6
7
8
# File 'lib/trick/function.rb', line 6

def self.extended(base)
  base.extend base
end

Instance Method Details

#[](*args, &block) ⇒ Object



18
19
20
# File 'lib/trick/function.rb', line 18

def [](*args, &block)
  curry[*args, &block]
end

#callObject



22
23
# File 'lib/trick/function.rb', line 22

def call(*)
end

#curry(arity = nil) ⇒ Object



14
15
16
# File 'lib/trick/function.rb', line 14

def curry(arity = nil)
  to_proc.curry(arity)
end

#to_procObject



10
11
12
# File 'lib/trick/function.rb', line 10

def to_proc
  method(:call).to_proc
end