Class: OpenAPISourceTools::ApiObjects::ServerAlternatives

Inherits:
Object
  • Object
show all
Includes:
Comparable
Defined in:
lib/openapi/sourcetools/apiobjects.rb

Overview

Combines servers array with set identifier.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(server_objects) ⇒ ServerAlternatives

Returns a new instance of ServerAlternatives.



349
350
351
352
# File 'lib/openapi/sourcetools/apiobjects.rb', line 349

def initialize(server_objects)
  @servers = server_objects.map { |so| ServerObject.new(so) }
  @servers.sort!
end

Instance Attribute Details

#serversObject (readonly)

Returns the value of attribute servers.



346
347
348
# File 'lib/openapi/sourcetools/apiobjects.rb', line 346

def servers
  @servers
end

#set_idObject

Returns the value of attribute set_id.



347
348
349
# File 'lib/openapi/sourcetools/apiobjects.rb', line 347

def set_id
  @set_id
end

Instance Method Details

#<=>(other) ⇒ Object



354
355
356
# File 'lib/openapi/sourcetools/apiobjects.rb', line 354

def <=>(other)
  @servers <=> other.servers
end