Class: Harbor::Hooks::Map

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

Instance Method Summary collapse

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

Returns:

  • (Boolean)


27
28
29
# File 'lib/harbor/hooks.rb', line 27

def has_key?(method_name)
  @map.has_key?(method_name)
end