Class: Lab42::Behavior::BoundBehavior
- Extended by:
- Forwarder
- Includes:
- Lab42::Behavior
- Defined in:
- lib/lab42/core/behavior/bound_behavior.rb
Overview
Thank youn my dear Proxy, for sending me all the information I, the clever guy, who is having all the fun, will make best use of it by being an extremly, yes I said extremly clever callable object representing the methods or instance methods represented by the calls to ‘Object#fn` or `Module#fm`. Did I tell you yet? It is sooooo out not be functional…
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.
-
#receiver ⇒ Object
readonly
Returns the value of attribute receiver.
Instance Method Summary collapse
- #call(*a, &b) ⇒ Object (also: #[])
- #to_proc ⇒ Object
Methods included from Composition
Methods included from Negation
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
13 14 15 |
# File 'lib/lab42/core/behavior/bound_behavior.rb', line 13 def args @args end |
#block ⇒ Object (readonly)
Returns the value of attribute block.
13 14 15 |
# File 'lib/lab42/core/behavior/bound_behavior.rb', line 13 def block @block end |
#method ⇒ Object (readonly)
Returns the value of attribute method.
13 14 15 |
# File 'lib/lab42/core/behavior/bound_behavior.rb', line 13 def method @method end |
#receiver ⇒ Object (readonly)
Returns the value of attribute receiver.
13 14 15 |
# File 'lib/lab42/core/behavior/bound_behavior.rb', line 13 def receiver @receiver end |
Instance Method Details
#call(*a, &b) ⇒ Object Also known as: []
18 19 20 21 |
# File 'lib/lab42/core/behavior/bound_behavior.rb', line 18 def call *a, &b method .( *(a + args), &(b||block) ) end |
#to_proc ⇒ Object
24 25 26 27 28 29 |
# File 'lib/lab42/core/behavior/bound_behavior.rb', line 24 def to_proc -> *a, &b do method .( *(a + args), &(b||block) ) end end |