Class: Jsapi::Meta::Server

Inherits:
Base::Model show all
Includes:
OpenAPI::Extensions
Defined in:
lib/jsapi/meta/server.rb

Overview

Specifiess a server object.

Constant Summary

Constants included from Base::Attributes

Base::Attributes::DEFAULT_ARRAY, Base::Attributes::DEFAULT_HASH

Instance Method Summary collapse

Methods included from OpenAPI::Extensions

#add_openapi_extension, #openapi_extensions, #openapi_extensions=

Methods inherited from Base::Model

#initialize, #inspect, #merge!, #reference?, #resolve

Methods included from Base::Attributes

#attribute, #attribute_names

Constructor Details

This class inherits a constructor from Jsapi::Meta::Base::Model

Instance Method Details

#descriptionObject

:attr: description The description of the server.



12
# File 'lib/jsapi/meta/server.rb', line 12

attribute :description, String

#to_openapiObject

Returns a hash representing the OpenAPI server object.



25
26
27
28
29
30
31
# File 'lib/jsapi/meta/server.rb', line 25

def to_openapi(*)
  with_openapi_extensions(
    url: url,
    description: description,
    variables: variables.transform_values(&:to_openapi).presence
  )
end

#urlObject

:attr: url The absolute or relative URL of the server.



17
# File 'lib/jsapi/meta/server.rb', line 17

attribute :url, String

#variablesObject

:attr_reader: variables The ServerVariable objects.



22
# File 'lib/jsapi/meta/server.rb', line 22

attribute :variables, { String => ServerVariable }