Class: Aikido::Zen::Request::Schema::AuthSchemas

Inherits:
Object
  • Object
show all
Defined in:
lib/aikido/zen/request/schema/auth_schemas.rb

Defined Under Namespace

Classes: ApiKey, Authorization

Constant Summary collapse

NONE =
new([])

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(schemas) ⇒ AuthSchemas

Returns a new instance of AuthSchemas.



8
9
10
# File 'lib/aikido/zen/request/schema/auth_schemas.rb', line 8

def initialize(schemas)
  @schemas = schemas
end

Instance Attribute Details

#schemasObject (readonly)

Returns the value of attribute schemas.



6
7
8
# File 'lib/aikido/zen/request/schema/auth_schemas.rb', line 6

def schemas
  @schemas
end

Instance Method Details

#==(other) ⇒ Object



21
22
23
# File 'lib/aikido/zen/request/schema/auth_schemas.rb', line 21

def ==(other)
  other.is_a?(self.class) && schemas == other.schemas
end

#as_jsonObject



17
18
19
# File 'lib/aikido/zen/request/schema/auth_schemas.rb', line 17

def as_json
  @schemas.map(&:as_json) unless @schemas.empty?
end

#merge(other) ⇒ Object Also known as: |



12
13
14
# File 'lib/aikido/zen/request/schema/auth_schemas.rb', line 12

def merge(other)
  self.class.new((schemas + other.schemas).uniq)
end