Class: OpenAPISourceTools::ScopedSecuritySchemeInfo

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ssi, scopes) ⇒ ScopedSecuritySchemeInfo

Returns a new instance of ScopedSecuritySchemeInfo.



80
81
82
83
# File 'lib/openapi/sourcetools/securityschemes.rb', line 80

def initialize(ssi, scopes)
  @ssi = ssi
  @scopes = scopes
end

Instance Attribute Details

#scopesObject (readonly)

Returns the value of attribute scopes.



78
79
80
# File 'lib/openapi/sourcetools/securityschemes.rb', line 78

def scopes
  @scopes
end

#ssiObject (readonly)

Returns the value of attribute ssi.



78
79
80
# File 'lib/openapi/sourcetools/securityschemes.rb', line 78

def ssi
  @ssi
end

Instance Method Details

#<=>(other) ⇒ Object



90
91
92
93
# File 'lib/openapi/sourcetools/securityschemes.rb', line 90

def <=>(other)
  # Only really interested in equality.
  @ssi <=> other.ssi || @scopes <=> other.scopes
end

#merge(other) ⇒ Object



85
86
87
88
# File 'lib/openapi/sourcetools/securityschemes.rb', line 85

def merge(other)
  @ssi = @ssi.merge(other.ssi)
  @scopes = @scopes.concat(other.scopes).uniq
end