Method: EasyApiDoc::Configurable#load_children

Defined in:
lib/configurable.rb

#load_children(klass, nodename = nil, options = {}) ⇒ Object



65
66
67
68
69
70
71
72
73
# File 'lib/configurable.rb', line 65

def load_children(klass, nodename = nil, options = {})
  ref = (nodename ? @attributes[nodename] : @attributes) || []
  parents = @parents.merge(self.class.to_s.split("::").last.downcase => self)
  ref.map do |name, opts|
    next if options[:exclude] && options[:exclude].include?(name)
    opts = opts.merge(options[:extra_attributes]) if options[:extra_attributes]
    klass.new(name, opts, parents)
  end.compact
end