Class: Jsapi::Meta::OpenAPI::Server
- Defined in:
- lib/jsapi/meta/openapi/server.rb
Overview
Represents a server object.
Instance Method Summary collapse
-
#description ⇒ Object
:attr: description The optional description of the server.
-
#to_openapi ⇒ Object
Returns a hash representing the server object.
-
#url ⇒ Object
:attr: url The absolute or relative URL of the server.
-
#variables ⇒ Object
:attr_reader: variables The optional server variables.
Methods inherited from Base
#initialize, #inspect, #reference?, #resolve
Methods included from Attributes::ClassMethods
Constructor Details
This class inherits a constructor from Jsapi::Meta::Base
Instance Method Details
#description ⇒ Object
:attr: description The optional description of the server.
11 |
# File 'lib/jsapi/meta/openapi/server.rb', line 11 attribute :description, String |
#to_openapi ⇒ Object
Returns a hash representing the server object.
24 25 26 27 28 29 30 |
# File 'lib/jsapi/meta/openapi/server.rb', line 24 def to_openapi(*) { url: url, description: description, variables: variables&.transform_values(&:to_openapi) }.compact end |
#url ⇒ Object
:attr: url The absolute or relative URL of the server.
16 |
# File 'lib/jsapi/meta/openapi/server.rb', line 16 attribute :url, String |
#variables ⇒ Object
:attr_reader: variables The optional server variables.
21 |
# File 'lib/jsapi/meta/openapi/server.rb', line 21 attribute :variables, { String => ServerVariable } |