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.



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

#serversObject (readonly)

Returns the value of attribute servers.



242
243
244
# File 'lib/openapi/sourcetools/apiobjects.rb', line 242

def servers
  @servers
end

#set_idObject

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