Class: Evri::RPX::Credentials

Inherits:
Object
  • Object
show all
Defined in:
lib/evri/rpx/credentials.rb

Instance Method Summary (collapse)

Constructor Details

- (Credentials) initialize(json)

A new instance of Credentials



4
5
6
# File 'lib/evri/rpx/credentials.rb', line 4

def initialize(json)
  @json = json
end

Instance Method Details

- (Boolean) facebook?

Returns true if these credentials are Facebook.

Returns:

  • (Boolean)


18
19
20
# File 'lib/evri/rpx/credentials.rb', line 18

def facebook?
  type == 'Facebook'
end

- (Object) facebook_expires

Returns when this Facebook session expires, as a Time object.



29
30
31
# File 'lib/evri/rpx/credentials.rb', line 29

def facebook_expires
  Time.at(@json['expires'].to_i)
end

- (Object) facebook_session_key

Returns the Facebook session key.



23
24
25
# File 'lib/evri/rpx/credentials.rb', line 23

def facebook_session_key
  @json['sessionKey']
end

- (Object) facebook_uid

Returns the UID for the authorized Facebook user.



34
35
36
# File 'lib/evri/rpx/credentials.rb', line 34

def facebook_uid
  @json['uid']
end

- (Boolean) oauth?

Returns true if these credentials are OAuth.

Returns:

  • (Boolean)


39
40
41
# File 'lib/evri/rpx/credentials.rb', line 39

def oauth?
  type == 'OAuth'
end

- (Object) oauth_token

Returns the OAuth token.



44
45
46
# File 'lib/evri/rpx/credentials.rb', line 44

def oauth_token
  @json['oauthToken']
end

- (Object) oauth_token_secret

Returns the OAuth token secret.



49
50
51
# File 'lib/evri/rpx/credentials.rb', line 49

def oauth_token_secret
  @json['oauthTokenSecret']
end

- (Object) type

Returns the type of credentials:

(Facebook|OAuth|WindowsLive)

Generally, you should use the helper methods such as #facebook?, #oauth?, #windows_live?



13
14
15
# File 'lib/evri/rpx/credentials.rb', line 13

def type
  @json['type']
end

- (Boolean) windows_live?

Returns true if these credentials are for Windows Live

Returns:

  • (Boolean)


54
55
56
# File 'lib/evri/rpx/credentials.rb', line 54

def windows_live?
  type == 'WindowsLive'
end

- (Object) windows_live_eact

Returns the Windows Live eact string, which contains the user's delegated authentication consent token.



60
61
62
# File 'lib/evri/rpx/credentials.rb', line 60

def windows_live_eact
  @json['eact']
end