Class: Callback
- Inherits:
-
Struct
- Object
- Struct
- Callback
- Defined in:
- lib/project/callback.rb
Instance Attribute Summary collapse
-
#args ⇒ Object
Returns the value of attribute args.
-
#called ⇒ Object
Returns the value of attribute called.
Instance Method Summary collapse
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name) ⇒ Object
2 3 4 |
# File 'lib/project/callback.rb', line 2 def method_missing(name, *) name == :"#{called}?" || (name == called && block_given? && yield(*args)) end |
Instance Attribute Details
#args ⇒ Object
Returns the value of attribute args
1 2 3 |
# File 'lib/project/callback.rb', line 1 def args @args end |
#called ⇒ Object
Returns the value of attribute called
1 2 3 |
# File 'lib/project/callback.rb', line 1 def called @called end |