Sha256: 6618569e110498d88e913c0b621bd098edc69f365ccc4ea6fecdc5bf572ccc76

Contents?: true

Size: 554 Bytes

Versions: 2

Compression:

Stored size: 554 Bytes

Contents

require_relative '../swagger/operation'
require_relative '../swagger/tag'

module Swaggard
  module Parsers
    class Controller

      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

    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
swaggard-1.0.1 lib/swaggard/parsers/controller.rb
swaggard-1.0.0 lib/swaggard/parsers/controller.rb