Class: JSH::Hooks

Inherits:
Pair
  • Object
show all
Defined in:
lib/jsh/hooks.rb

Constant Summary collapse

DEFAULT_HOOKS =
{
  :before => [],
  :after  => []
}

Instance Attribute Summary

Attributes inherited from Pair

#data

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_dataObject



12
13
14
# File 'lib/jsh/hooks.rb', line 12

def default_data
  DEFAULT_HOOKS
end