Class: Jsapi::Meta::OpenAPI::ServerVariable
- Defined in:
- lib/jsapi/meta/openapi/server_variable.rb
Overview
Represents a server variable object.
Instance Method Summary collapse
-
#default ⇒ Object
:attr: default The default value of the server variable.
-
#description ⇒ Object
:attr: description The optional description of the server variable.
-
#enum ⇒ Object
:attr: enum The values of the server variable.
-
#to_openapi ⇒ Object
Returns a hash representing the server variable object.
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
#default ⇒ Object
:attr: default The default value of the server variable.
11 |
# File 'lib/jsapi/meta/openapi/server_variable.rb', line 11 attribute :default, String |
#description ⇒ Object
:attr: description The optional description of the server variable.
16 |
# File 'lib/jsapi/meta/openapi/server_variable.rb', line 16 attribute :description, String |
#enum ⇒ Object
:attr: enum The values of the server variable.
21 |
# File 'lib/jsapi/meta/openapi/server_variable.rb', line 21 attribute :enum, [String] |
#to_openapi ⇒ Object
Returns a hash representing the server variable object.
24 25 26 27 28 29 30 |
# File 'lib/jsapi/meta/openapi/server_variable.rb', line 24 def to_openapi(*) { default: default, enum: enum.presence, # must not be empty description: description }.compact end |