Module: Roar::Representer::InheritableArray::ConfigExtensions

Defined in:
lib/roar/representer.rb

Instance Method Summary collapse

Instance Method Details

#inherit(parent) ⇒ Object



20
21
22
23
24
25
26
# File 'lib/roar/representer.rb', line 20

def inherit(parent)
  super

  parent.inheritable_arrays.keys.each do |k|
    inheritable_array(k).push *parent.inheritable_array(k).clone
  end
end

#inheritable_array(name) ⇒ Object



13
14
15
# File 'lib/roar/representer.rb', line 13

def inheritable_array(name)
  inheritable_arrays[name] ||= []
end

#inheritable_arraysObject



16
17
18
# File 'lib/roar/representer.rb', line 16

def inheritable_arrays
  @inheritable_arrays ||= {}
end