Top Level Namespace
Defined Under Namespace
Modules: Enumerable, Kernel, Lab42
Classes: Array, Dir, File, Hash, Module, Object, OpenObject, Proc
Constant Summary
collapse
- Identity =
Lab42::Behavior::ProcBehavior.new{ |x| x }
Instance Method Summary
collapse
Methods included from Kernel
#require_relative_dir
Instance Method Details
#_realize_args_(para, args) ⇒ Object
6
7
8
|
# File 'lib/lab42/core/console_tools/func.rb', line 6
def _realize_args_ para, args
args.map{ |arg| Proc === arg ? arg.(para) :arg }
end
|
10
11
12
13
14
15
16
17
18
19
|
# File 'lib/lab42/core/console_tools/func.rb', line 10
def _transform_for_f_ args
args.map do | arg |
case arg
when Array
f *arg
else
arg
end
end
end
|
21
22
23
24
25
26
27
28
29
30
31
32
33
|
# File 'lib/lab42/core/console_tools/func.rb', line 21
def f *args
args = _transform_for_f_ args
if Symbol === args.first
-> r do
r.send *_realize_args_( r, args )
end
else
-> *r do
args.first.send *_realize_args_( r.first, args.drop(1) )
end
end
end
|