Sha256: e282f687f26ab94e07d7ef4af9a840c01a95474cd61d3ac6664d9adcba208cb7

Contents?: true

Size: 701 Bytes

Versions: 14

Compression:

Stored size: 701 Bytes

Contents

module Praxis
  module Docs
    module OpenApi
      class ServerObject
        # https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#server-object
        attr_reader :url, :description, :variables
        def initialize(url: , description: nil, variables: [])
          @url = url
          @description = description
          @variables = variables
          raise "OpenApi docs require a 'url' for your server object." unless url
        end

        def dump
          result = {url: url}
          result[:description] = description if description
          result[:variables] = variables unless variables.empty?

          result
        end
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
praxis-2.0.pre.18 lib/praxis/docs/open_api/server_object.rb
praxis-2.0.pre.17 lib/praxis/docs/open_api/server_object.rb
praxis-2.0.pre.16 lib/praxis/docs/open_api/server_object.rb
praxis-2.0.pre.15 lib/praxis/docs/open_api/server_object.rb
praxis-2.0.pre.14 lib/praxis/docs/open_api/server_object.rb
praxis-2.0.pre.13 lib/praxis/docs/open_api/server_object.rb
praxis-2.0.pre.12 lib/praxis/docs/open_api/server_object.rb
praxis-2.0.pre.11 lib/praxis/docs/open_api/server_object.rb
praxis-2.0.pre.10 lib/praxis/docs/open_api/server_object.rb
praxis-2.0.pre.9 lib/praxis/docs/openapi/server_object.rb
praxis-2.0.pre.8 lib/praxis/docs/openapi/server_object.rb
praxis-2.0.pre.7 lib/praxis/docs/openapi/server_object.rb
praxis-2.0.pre.6 lib/praxis/docs/openapi/server_object.rb
praxis-2.0.pre.5 lib/praxis/docs/openapi/server_object.rb