Class: YleTf::Plugin::ActionHook
- Inherits:
-
Object
- Object
- YleTf::Plugin::ActionHook
- Defined in:
- lib/yle_tf/plugin/action_hook.rb
Instance Attribute Summary collapse
-
#actions ⇒ Object
readonly
Returns the value of attribute actions.
Instance Method Summary collapse
- #after(existing, new, *args, &block) ⇒ Object
- #before(existing, new, *args, &block) ⇒ Object
-
#initialize(actions) ⇒ ActionHook
constructor
A new instance of ActionHook.
Constructor Details
#initialize(actions) ⇒ ActionHook
Returns a new instance of ActionHook.
6 7 8 |
# File 'lib/yle_tf/plugin/action_hook.rb', line 6 def initialize(actions) @actions = actions end |
Instance Attribute Details
#actions ⇒ Object (readonly)
Returns the value of attribute actions.
4 5 6 |
# File 'lib/yle_tf/plugin/action_hook.rb', line 4 def actions @actions end |
Instance Method Details
#after(existing, new, *args, &block) ⇒ Object
14 15 16 |
# File 'lib/yle_tf/plugin/action_hook.rb', line 14 def after(existing, new, *args, &block) actions.insert_after(existing, new, *args, &block) if actions.include?(existing) end |
#before(existing, new, *args, &block) ⇒ Object
10 11 12 |
# File 'lib/yle_tf/plugin/action_hook.rb', line 10 def before(existing, new, *args, &block) actions.insert_before(existing, new, *args, &block) if actions.include?(existing) end |