Class: AppleID::EventToken

Inherits:
OpenIDConnect::ConnectObject
  • Object
show all
Defined in:
lib/apple_id/event_token.rb

Defined Under Namespace

Classes: Event, VerificationFailed

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ EventToken

Returns a new instance of EventToken.



11
12
13
14
# File 'lib/apple_id/event_token.rb', line 11

def initialize(attributes = {})
  super
  @events = Event.decode attributes[:events]
end

Class Method Details

.decode(jwt_string) ⇒ Object



23
24
25
# File 'lib/apple_id/event_token.rb', line 23

def decode(jwt_string)
  new JSON::JWT.decode jwt_string, :skip_verification
end

Instance Method Details

#verify!(verify_signature: true, client: nil) ⇒ Object



16
17
18
19
20
# File 'lib/apple_id/event_token.rb', line 16

def verify!(verify_signature: true, client: nil)
  verify_signature! if verify_signature
  verify_claims! client
  self
end