Sha256: 0d6cc952932e6fed7e30fd0a5c5481a6a5ba3357bb50eb311c05e3ff873cb5b5

Contents?: true

Size: 994 Bytes

Versions: 12

Compression:

Stored size: 994 Bytes

Contents

# frozen_string_literal: true

module R2OAS
  module AppConfiguration
    class Swagger
      class Editor
        DEFAULT_IMAGE         = 'swaggerapi/swagger-editor'
        DEFAULT_PORT          = '81'
        DEFAULT_EXPOSED_PORT  = '8080/tcp'
        DEFAULT_STORAGE_KEY   = 'swagger-editor-content' # Fixed
        DEFAULT_HOST          = 'http://localhost'       # Fixed

        VALID_OPTIONS_KEYS = %i[
          image
          port
          exposed_port
        ].freeze

        attr_accessor *VALID_OPTIONS_KEYS

        def initialize
          set_default
        end

        def configure
          yield self
        end

        def url
          "#{DEFAULT_HOST}:#{port}"
        end

        def storage_key
          DEFAULT_STORAGE_KEY
        end

        private

        def set_default
          self.image         = DEFAULT_IMAGE
          self.port          = DEFAULT_PORT
          self.exposed_port  = DEFAULT_EXPOSED_PORT
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
r2-oas-0.5.0 lib/r2-oas/app_configuration/swagger/editor.rb
r2-oas-0.4.1 lib/r2-oas/app_configuration/swagger/editor.rb
r2-oas-0.4.0 lib/r2-oas/app_configuration/swagger/editor.rb
r2-oas-0.3.4 lib/r2-oas/app_configuration/swagger/editor.rb
r2-oas-0.3.3 lib/r2-oas/app_configuration/swagger/editor.rb
r2-oas-0.3.2 lib/r2-oas/app_configuration/swagger/editor.rb
r2-oas-0.3.1 lib/r2-oas/app_configuration/swagger/editor.rb
r2-oas-0.3.0 lib/r2-oas/app_configuration/swagger/editor.rb
r2-oas-0.2.0 lib/r2-oas/app_configuration/swagger/editor.rb
r2-oas-0.1.3 lib/r2-oas/app_configuration/swagger/editor.rb
r2-oas-0.1.2 lib/r2-oas/app_configuration/swagger/editor.rb
r2-oas-0.1.0 lib/r2-oas/app_configuration/swagger/editor.rb