Class: Swaggard::Parsers::Controller

Inherits:
Object
  • Object
show all
Defined in:
lib/swaggard/parsers/controller.rb

Instance Method Summary collapse

Instance Method Details

#run(yard_objects) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/swaggard/parsers/controller.rb', line 8

def run(yard_objects)
  tag = nil
  operations = {}

  yard_objects.each do |yard_object|
    if yard_object.type == :class
      tag = Swagger::Tag.new(yard_object)
    elsif tag && yard_object.type == :method
      name = yard_object.name
      operations[name.to_s] = yard_object
    end
  end

  return tag, operations
end