Module: Lab42::Meta::Behavior
Instance Method Summary collapse
Instance Method Details
#behavior(*args, &blk) ⇒ Object
4 5 6 7 |
# File 'lib/lab42/core/meta/behavior.rb', line 4 def behavior *args, &blk return blk if blk determine_behavior_from args end |
#call_with_arity(blk, params, base_arity: 1) ⇒ Object
9 10 11 12 |
# File 'lib/lab42/core/meta/behavior.rb', line 9 def call_with_arity blk, params, base_arity: 1 return blk.(*params.first(base_arity)) if blk.arity < 0 blk.(*params.first(blk.arity)) end |