Method: Tins::Concern#append_features

Defined in:
lib/tins/concern.rb

#append_features(base) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/tins/concern.rb', line 7

def append_features(base)
  if base.instance_variable_defined?("@_dependencies")
    base.instance_variable_get("@_dependencies") << self
    false
  else
    return false if base < self
    @_dependencies.each { |dep| base.send(:include, dep) }
    super
    base.extend const_get("ClassMethods") if const_defined?("ClassMethods")
    base.class_eval(&@_included_block) if instance_variable_defined?("@_included_block")
    Thread.current[:tin_concern_args] = nil
    true
  end
end