Class: JSH::Hooks
Constant Summary collapse
- DEFAULT_HOOKS =
{ :before => [], :after => [] }
Instance Attribute Summary
Attributes inherited from Pair
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Pair
#[], #[]=, #all, #initialize
Constructor Details
This class inherits a constructor from JSH::Pair
Class Method Details
.register(key, &block) ⇒ Object
16 17 18 |
# File 'lib/jsh/hooks.rb', line 16 def self.register(key, &block) (DEFAULT_HOOKS[key] ||= []) << block end |
Instance Method Details
#default_data ⇒ Object
12 13 14 |
# File 'lib/jsh/hooks.rb', line 12 def default_data DEFAULT_HOOKS end |