Module: Kangaru::Concern

Included in:
Attributable, Configurable, Validatable
Defined in:
lib/kangaru/concern.rb

Instance Method Summary collapse

Instance Method Details

#append_features(base) ⇒ Object



3
4
5
6
# File 'lib/kangaru/concern.rb', line 3

def append_features(base)
  super
  evaluate_concern_blocks!(base)
end

#class_methodsObject



8
9
10
11
12
13
14
# File 'lib/kangaru/concern.rb', line 8

def class_methods(&)
  if const_defined?(:ClassMethods)
    const_get(:ClassMethods)
  else
    const_set(:ClassMethods, Module.new)
  end.module_eval(&)
end

#included(base = nil, &block) ⇒ Object



16
17
18
19
20
21
# File 'lib/kangaru/concern.rb', line 16

def included(base = nil, &block)
  super base if base
  return if block.nil?

  @included = block
end