Method: APISpec::Namespace#all

Defined in:
lib/apispec/namespace.rb

#all(method, type) ⇒ Object



38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/apispec/namespace.rb', line 38

def all(method, type)
  nodes = []
  @nodes.keys.sort.each do |name|
    node = @nodes[name]
    if node.is_a? APISpec::Namespace
      nodes << node.send(method)
    elsif node.is_a? type
      nodes << node
    end
  end
  nodes.flatten
end