Class: OpenAPISourceTools::ApiObjects::ServerVariableObject
- Inherits:
-
Object
- Object
- OpenAPISourceTools::ApiObjects::ServerVariableObject
- Includes:
- Comparable
- Defined in:
- lib/openapi/sourcetools/apiobjects.rb
Overview
Single server variable object.
Instance Attribute Summary collapse
-
#default ⇒ Object
readonly
Returns the value of attribute default.
-
#enum ⇒ Object
readonly
Returns the value of attribute enum.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
-
#initialize(name, variable_object) ⇒ ServerVariableObject
constructor
A new instance of ServerVariableObject.
Constructor Details
#initialize(name, variable_object) ⇒ ServerVariableObject
Returns a new instance of ServerVariableObject.
301 302 303 304 305 |
# File 'lib/openapi/sourcetools/apiobjects.rb', line 301 def initialize(name, variable_object) @name = name @default = variable_object['default'] @enum = (variable_object['enum'] || []).sort! end |
Instance Attribute Details
#default ⇒ Object (readonly)
Returns the value of attribute default.
299 300 301 |
# File 'lib/openapi/sourcetools/apiobjects.rb', line 299 def default @default end |
#enum ⇒ Object (readonly)
Returns the value of attribute enum.
299 300 301 |
# File 'lib/openapi/sourcetools/apiobjects.rb', line 299 def enum @enum end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
299 300 301 |
# File 'lib/openapi/sourcetools/apiobjects.rb', line 299 def name @name end |
Instance Method Details
#<=>(other) ⇒ Object
307 308 309 310 311 312 313 |
# File 'lib/openapi/sourcetools/apiobjects.rb', line 307 def <=>(other) d = @name <=> other.name return d unless d.zero? d = @default <=> other.default return d unless d.zero? @enum <=> other.enum end |