Module: Lab42::AOP::Before
Instance Method Summary collapse
Instance Method Details
#with_block(rcv, tgts, **kwds, &blk) ⇒ Object
4 5 6 7 8 9 |
# File 'lib/lab42/aop/before.rb', line 4 def with_block rcv, tgts, **kwds, &blk concerns = CrossConcern.get_methods rcv, Array( tgts ), **kwds concerns.each do | tgt_concern | _define_block_before tgt_concern, blk end end |
#with_methods(rcv, tgts, aops, **kwds) ⇒ Object
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/lab42/aop/before.rb', line 11 def with_methods rcv, tgts, aops, **kwds # aops loop must be outer loop as _define_method_before will change # the result of CrossConcern.get_methods rcv, ... Array( aops ).each do | aop | concerns = CrossConcern.get_methods rcv, Array( tgts ), **kwds concerns.each do | tgt_concern | _define_method_before tgt_concern, aop end end end |