Class: Mimas::Hooks
- Inherits:
-
Object
- Object
- Mimas::Hooks
- Defined in:
- lib/mimas/hooks.rb
Constant Summary collapse
- POINTS =
[ :before_push, :after_push ]
Instance Method Summary collapse
- #[](hook) ⇒ Object
-
#initialize ⇒ Hooks
constructor
A new instance of Hooks.
- #merge(with_hooks) ⇒ Object
Constructor Details
Instance Method Details
#[](hook) ⇒ Object
9 10 11 |
# File 'lib/mimas/hooks.rb', line 9 def [](hook) @hooks[hook] end |
#merge(with_hooks) ⇒ Object
13 14 15 16 17 |
# File 'lib/mimas/hooks.rb', line 13 def merge(with_hooks) POINTS.each do |point| @hooks[point].push(*with_hooks[point]) end end |