Sha256: ab455cf4008fc1629bb9e690d61f96db4d231eba6fe4c07dc5e4f9776de213de

Contents?: true

Size: 434 Bytes

Versions: 12

Compression:

Stored size: 434 Bytes

Contents

require_relative 'operation'

module Swaggard
  module Swagger
    class Path

      attr_reader :path

      def initialize(path)
        @path = path
        @operations = {}
      end

      def add_operation(operation)
        @operations[operation.http_method.downcase] = operation
      end

      def to_doc
        Hash[@operations.map { |http_method, operation| [http_method, operation.to_doc] }]
      end

    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
swaggard-0.5.4 lib/swaggard/swagger/path.rb
swaggard-0.5.3 lib/swaggard/swagger/path.rb
swaggard-0.5.2 lib/swaggard/swagger/path.rb
swaggard-0.5.1 lib/swaggard/swagger/path.rb
swaggard-0.5.0 lib/swaggard/swagger/path.rb
swaggard-0.4.0 lib/swaggard/swagger/path.rb
swaggard-0.3.0 lib/swaggard/swagger/path.rb
swaggard-0.2.1 lib/swaggard/swagger/path.rb
swaggard-0.2.0 lib/swaggard/swagger/path.rb
swaggard-0.1.1 lib/swaggard/swagger/path.rb
swaggard-0.1.0 lib/swaggard/swagger/path.rb
swaggard-0.0.4 lib/swaggard/swagger/path.rb