Module: Contracts::MethodDecorators

Defined in:
lib/contracts/decorators.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.extended(klass) ⇒ Object



5
6
7
# File 'lib/contracts/decorators.rb', line 5

def self.extended(klass)
  Engine.apply(klass)
end

Instance Method Details

#inherited(subclass) ⇒ Object



9
10
11
12
# File 'lib/contracts/decorators.rb', line 9

def inherited(subclass)
  Engine.fetch_from(subclass).set_eigenclass_owner
  super
end

#method_added(name) ⇒ Object



14
15
16
17
# File 'lib/contracts/decorators.rb', line 14

def method_added(name)
  MethodHandler.new(name, false, self).handle
  super
end

#singleton_method_added(name) ⇒ Object



19
20
21
22
# File 'lib/contracts/decorators.rb', line 19

def singleton_method_added(name)
  MethodHandler.new(name, true, self).handle
  super
end