Class: OsCtld::Pool::Hooks::Base
- Inherits:
-
Hook::Base
- Object
- Hook::Base
- OsCtld::Pool::Hooks::Base
- Defined in:
- lib/osctld/pool/hooks.rb
Direct Known Subclasses
Instance Attribute Summary collapse
- #pool ⇒ Pool readonly
Attributes inherited from Hook::Base
Class Method Summary collapse
-
.pool_hook(hook_name) ⇒ Object
Register pool hook under a name.
Instance Method Summary collapse
- #environment ⇒ Object protected
- #setup ⇒ Object
Methods inherited from Hook::Base
blocking, blocking?, #blocking?, #exec, #executable, hook, #initialize
Constructor Details
This class inherits a constructor from OsCtld::Hook::Base
Instance Attribute Details
Class Method Details
.pool_hook(hook_name) ⇒ Object
Register pool hook under a name
8 9 10 |
# File 'lib/osctld/pool/hooks.rb', line 8 def self.pool_hook(hook_name) hook(Pool, hook_name, self) end |
Instance Method Details
#environment ⇒ Object (protected)
21 22 23 24 25 26 27 |
# File 'lib/osctld/pool/hooks.rb', line 21 def environment super.merge({ 'OSCTL_POOL_NAME' => pool.name, 'OSCTL_POOL_DATASET' => pool.dataset, 'OSCTL_POOL_STATE' => pool.state.to_s }) end |
#setup ⇒ Object
15 16 17 |
# File 'lib/osctld/pool/hooks.rb', line 15 def setup @pool = event_instance end |