Class: Oldtime::Instance
- Inherits:
-
Object
- Object
- Oldtime::Instance
- Defined in:
- lib/oldtime/instance.rb
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
Returns the value of attribute action.
-
#instance ⇒ Object
readonly
Returns the value of attribute instance.
Instance Method Summary collapse
-
#initialize(action, instance, before_hooks = [], after_hooks = []) ⇒ Instance
constructor
A new instance of Instance.
- #run ⇒ Object
Constructor Details
#initialize(action, instance, before_hooks = [], after_hooks = []) ⇒ Instance
Returns a new instance of Instance.
5 6 7 8 9 10 |
# File 'lib/oldtime/instance.rb', line 5 def initialize(action, instance, before_hooks=[], after_hooks=[]) @action = action @instance = instance @before_hooks = before_hooks @after_hooks = after_hooks end |
Instance Attribute Details
#action ⇒ Object (readonly)
Returns the value of attribute action.
3 4 5 |
# File 'lib/oldtime/instance.rb', line 3 def action @action end |
#instance ⇒ Object (readonly)
Returns the value of attribute instance.
3 4 5 |
# File 'lib/oldtime/instance.rb', line 3 def instance @instance end |
Instance Method Details
#run ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/oldtime/instance.rb', line 12 def run run_hooks(:before, @before_hooks) run_instance(@action, @instance) run_hooks(:after, @after_hooks) end |