Class: Harbor::Hooks::Map
- Inherits:
-
Object
- Object
- Harbor::Hooks::Map
- Defined in:
- lib/harbor/hooks.rb
Instance Method Summary collapse
- #[](method_name) ⇒ Object
- #has_key?(method_name) ⇒ Boolean
-
#initialize(target) ⇒ Map
constructor
A new instance of Map.
Constructor Details
#initialize(target) ⇒ Map
Returns a new instance of Map.
22 23 24 25 |
# File 'lib/harbor/hooks.rb', line 22 def initialize(target) @map = {} @target = target end |
Instance Method Details
#[](method_name) ⇒ Object
31 32 33 |
# File 'lib/harbor/hooks.rb', line 31 def [](method_name) @map[method_name] ||= Chain.new(@target, method_name) end |
#has_key?(method_name) ⇒ Boolean
27 28 29 |
# File 'lib/harbor/hooks.rb', line 27 def has_key?(method_name) @map.has_key?(method_name) end |