Class: Macaroons::Caveat
- Inherits:
-
Object
- Object
- Macaroons::Caveat
- Defined in:
- lib/macaroons/caveat.rb
Instance Attribute Summary collapse
-
#caveat_id ⇒ Object
Returns the value of attribute caveat_id.
-
#caveat_location ⇒ Object
Returns the value of attribute caveat_location.
-
#verification_id ⇒ Object
Returns the value of attribute verification_id.
Instance Method Summary collapse
- #first_party? ⇒ Boolean
-
#initialize(caveat_id, verification_id = nil, caveat_location = nil) ⇒ Caveat
constructor
A new instance of Caveat.
- #third_party? ⇒ Boolean
- #to_h ⇒ Object
Constructor Details
#initialize(caveat_id, verification_id = nil, caveat_location = nil) ⇒ Caveat
Returns a new instance of Caveat.
3 4 5 6 7 |
# File 'lib/macaroons/caveat.rb', line 3 def initialize(caveat_id, verification_id=nil, caveat_location=nil) @caveat_id = caveat_id @verification_id = verification_id @caveat_location = caveat_location end |
Instance Attribute Details
#caveat_id ⇒ Object
Returns the value of attribute caveat_id.
9 10 11 |
# File 'lib/macaroons/caveat.rb', line 9 def caveat_id @caveat_id end |
#caveat_location ⇒ Object
Returns the value of attribute caveat_location.
11 12 13 |
# File 'lib/macaroons/caveat.rb', line 11 def caveat_location @caveat_location end |
#verification_id ⇒ Object
Returns the value of attribute verification_id.
10 11 12 |
# File 'lib/macaroons/caveat.rb', line 10 def verification_id @verification_id end |
Instance Method Details
#first_party? ⇒ Boolean
13 14 15 |
# File 'lib/macaroons/caveat.rb', line 13 def first_party? verification_id.nil? end |
#third_party? ⇒ Boolean
17 18 19 |
# File 'lib/macaroons/caveat.rb', line 17 def third_party? !first_party? end |
#to_h ⇒ Object
21 22 23 |
# File 'lib/macaroons/caveat.rb', line 21 def to_h {'cid' => @caveat_id, 'vid' => @verification_id, 'cl' => @caveat_location} end |