Method: ChainableMethods.included

Defined in:
lib/chainable_methods.rb

.included(base) ⇒ Object



12
13
14
15
16
17
18
19
20
# File 'lib/chainable_methods.rb', line 12

def self.included(base)
  base.extend(self)
  begin
    # this way the module doesn't have to declare all methods as class methods
    base.extend(base) if base.kind_of?(Module)
  rescue TypeError
    # wrong argument type Class (expected Module)
  end
end