Sha256: 336e3608cccb4cffc812d8b99dd8cb95f3857cde0693eab3b0bbb6bfeddbfc5a

Contents?: true

Size: 433 Bytes

Versions: 9

Compression:

Stored size: 433 Bytes

Contents

require_relative 'type'

module Swaggard
  module Swagger
    class Property

      attr_reader :id, :type, :description

      def initialize(yard_object)
        @id = yard_object.name
        @type = Type.new(yard_object.types)
        @description = yard_object.text
      end

      def to_doc
        result = @type.to_doc
        result['description'] = @description if @description
        result
      end

    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
swaggard-0.5.1 lib/swaggard/swagger/property.rb
swaggard-0.5.0 lib/swaggard/swagger/property.rb
swaggard-0.4.0 lib/swaggard/swagger/property.rb
swaggard-0.3.0 lib/swaggard/swagger/property.rb
swaggard-0.2.1 lib/swaggard/swagger/property.rb
swaggard-0.2.0 lib/swaggard/swagger/property.rb
swaggard-0.1.1 lib/swaggard/swagger/property.rb
swaggard-0.1.0 lib/swaggard/swagger/property.rb
swaggard-0.0.4 lib/swaggard/swagger/property.rb