Module: Surrounded::Context::NameCollisionDetector

Defined in:
lib/surrounded/context/name_collision_detector.rb

Defined Under Namespace

Modules: NameCollisionHandler

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#handlerObject (readonly)

Returns the value of attribute handler.



6
7
8
# File 'lib/surrounded/context/name_collision_detector.rb', line 6

def handler
  @handler
end

Class Method Details

.extended(base) ⇒ Object



8
9
10
11
# File 'lib/surrounded/context/name_collision_detector.rb', line 8

def self.extended(base)
  base.send :include, NameCollisionHandler
  Surrounded::Exceptions.define(base, exceptions: :NameCollisionError)
end

Instance Method Details

#on_name_collision(method_name) ⇒ Object



13
14
15
# File 'lib/surrounded/context/name_collision_detector.rb', line 13

def on_name_collision(method_name)
  @handler = method_name
end