Sha256: 344aec920818425b5eaf68b4e3b97cfec3721facafd62487bb013c2b6c312cb7

Contents?: true

Size: 594 Bytes

Versions: 16

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.path)

          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

16 entries across 16 versions & 1 rubygems

Version Path
swaggard-1.1.1 lib/swaggard/parsers/models.rb
swaggard-1.1.0 lib/swaggard/parsers/models.rb
swaggard-1.0.2 lib/swaggard/parsers/models.rb
swaggard-1.0.1 lib/swaggard/parsers/models.rb
swaggard-1.0.0 lib/swaggard/parsers/models.rb
swaggard-0.5.4 lib/swaggard/parsers/models.rb
swaggard-0.5.3 lib/swaggard/parsers/models.rb
swaggard-0.5.2 lib/swaggard/parsers/models.rb
swaggard-0.5.1 lib/swaggard/parsers/models.rb
swaggard-0.5.0 lib/swaggard/parsers/models.rb
swaggard-0.4.0 lib/swaggard/parsers/models.rb
swaggard-0.3.0 lib/swaggard/parsers/models.rb
swaggard-0.2.1 lib/swaggard/parsers/models.rb
swaggard-0.2.0 lib/swaggard/parsers/models.rb
swaggard-0.1.1 lib/swaggard/parsers/models.rb
swaggard-0.1.0 lib/swaggard/parsers/models.rb