Sha256: 4b868cd67bf5ab90509294126ed48b57e2402b93ac325aa9180b6289dc42275d

Contents?: true

Size: 594 Bytes

Versions: 1

Compression:

Stored size: 594 Bytes

Contents

require_relative '../swagger/definition'
require_relative '../swagger/property'

module Swaggard
  module Parsers
    class Models

      def run(yard_objects)
        definitions = []

        yard_objects.each do |yard_object|
          next unless yard_object.type == :class

          definition = Swagger::Definition.new(yard_object.name)

          yard_object.tags.each do |tag|
            property = Swagger::Property.new(tag)
            definition.add_property(property)
          end

          definitions << definition
        end

        definitions
      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
swaggard-0.0.4 lib/swaggard/parsers/models.rb