Class: CaveatEmptor::Macaroon

Inherits:
Object
  • Object
show all
Defined in:
lib/caveat_emptor/macaroon.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(protocol_version:, location:, id:, caveats:, signature:) ⇒ Macaroon

Returns a new instance of Macaroon.



15
16
17
18
19
20
21
# File 'lib/caveat_emptor/macaroon.rb', line 15

def initialize(protocol_version:, location:, id:, caveats:, signature:)
  @protocol_version = protocol_version
  @location = location
  @id = id
  @caveats = caveats
  @signature = signature
end

Instance Attribute Details

#caveatsObject (readonly)

Returns the value of attribute caveats.



13
14
15
# File 'lib/caveat_emptor/macaroon.rb', line 13

def caveats
  @caveats
end

#idObject (readonly)

Returns the value of attribute id.



13
14
15
# File 'lib/caveat_emptor/macaroon.rb', line 13

def id
  @id
end

#locationObject (readonly)

Returns the value of attribute location.



13
14
15
# File 'lib/caveat_emptor/macaroon.rb', line 13

def location
  @location
end

#protocol_versionObject (readonly)

Returns the value of attribute protocol_version.



13
14
15
# File 'lib/caveat_emptor/macaroon.rb', line 13

def protocol_version
  @protocol_version
end

#signatureObject (readonly)

Returns the value of attribute signature.



13
14
15
# File 'lib/caveat_emptor/macaroon.rb', line 13

def signature
  @signature
end

Instance Method Details

#==(other) ⇒ Object Also known as: eql?



23
24
25
26
27
28
29
30
# File 'lib/caveat_emptor/macaroon.rb', line 23

def ==(other)
  other.is_a?(Macaroon) &&
    protocol_version == other.protocol_version &&
    location == other.location &&
    id == other.id &&
    caveats == other.caveats &&
    signature == other.signature
end