Class: Lab42::Behavior::SendBehavior
- Includes:
- Lab42::Behavior
- Defined in:
- lib/lab42/core/behavior/send_behavior.rb
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#block ⇒ Object
readonly
Returns the value of attribute block.
-
#method ⇒ Object
readonly
Returns the value of attribute method.
Instance Method Summary collapse
Methods included from Composition
Methods included from Negation
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
5 6 7 |
# File 'lib/lab42/core/behavior/send_behavior.rb', line 5 def args @args end |
#block ⇒ Object (readonly)
Returns the value of attribute block.
5 6 7 |
# File 'lib/lab42/core/behavior/send_behavior.rb', line 5 def block @block end |
#method ⇒ Object (readonly)
Returns the value of attribute method.
5 6 7 |
# File 'lib/lab42/core/behavior/send_behavior.rb', line 5 def method @method end |
Instance Method Details
#arity ⇒ Object
7 |
# File 'lib/lab42/core/behavior/send_behavior.rb', line 7 def arity; -1 end |
#call(rcv, *a, &b) ⇒ Object
9 10 11 |
# File 'lib/lab42/core/behavior/send_behavior.rb', line 9 def call rcv, *a, &b rcv.send( method, *(a+args), &(b||block) ) end |
#to_proc ⇒ Object
13 14 15 16 17 |
# File 'lib/lab42/core/behavior/send_behavior.rb', line 13 def to_proc -> rcv, *a, &b do rcv.send( method, *(a+args), &(b||block) ) end end |