Class: OpenAPISourceTools::ApiObjects::ServerAlternatives
- Inherits:
-
Object
- Object
- OpenAPISourceTools::ApiObjects::ServerAlternatives
- Includes:
- Comparable
- Defined in:
- lib/openapi/sourcetools/apiobjects.rb
Overview
Combines servers array with set identifier.
Instance Attribute Summary collapse
-
#servers ⇒ Object
readonly
Returns the value of attribute servers.
-
#set_id ⇒ Object
Returns the value of attribute set_id.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
-
#initialize(server_objects) ⇒ ServerAlternatives
constructor
A new instance of ServerAlternatives.
Constructor Details
#initialize(server_objects) ⇒ ServerAlternatives
Returns a new instance of ServerAlternatives.
245 246 247 248 |
# File 'lib/openapi/sourcetools/apiobjects.rb', line 245 def initialize(server_objects) @servers = server_objects.map { |so| ServerObject.new(so) } @servers.sort! end |
Instance Attribute Details
#servers ⇒ Object (readonly)
Returns the value of attribute servers.
242 243 244 |
# File 'lib/openapi/sourcetools/apiobjects.rb', line 242 def servers @servers end |
#set_id ⇒ Object
Returns the value of attribute set_id.
243 244 245 |
# File 'lib/openapi/sourcetools/apiobjects.rb', line 243 def set_id @set_id end |
Instance Method Details
#<=>(other) ⇒ Object
250 251 252 |
# File 'lib/openapi/sourcetools/apiobjects.rb', line 250 def <=>(other) @servers <=> other.servers end |