Class: WindowsLiveLogin::ConsentToken
- Inherits:
-
Object
- Object
- WindowsLiveLogin::ConsentToken
- Defined in:
- lib/contacts/windowslivelogin.rb
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
-
#decodedtoken ⇒ Object
readonly
Returns the value of attribute decodedtoken.
-
#delegationtoken ⇒ Object
readonly
Returns the value of attribute delegationtoken.
-
#expiry ⇒ Object
readonly
Returns the value of attribute expiry.
-
#locationid ⇒ Object
readonly
Returns the value of attribute locationid.
-
#offers ⇒ Object
readonly
Returns the value of attribute offers.
-
#offers_string ⇒ Object
readonly
Returns the value of attribute offers_string.
-
#refreshtoken ⇒ Object
readonly
Returns the value of attribute refreshtoken.
-
#sessionkey ⇒ Object
readonly
Returns the value of attribute sessionkey.
-
#token ⇒ Object
readonly
Returns the value of attribute token.
Instance Method Summary collapse
-
#initialize(wll, delegationtoken, refreshtoken, sessionkey, expiry, offers, locationid, context, decodedtoken, token) ⇒ ConsentToken
constructor
Initialize the ConsentToken module with the WindowsLiveLogin, delegation token, refresh token, session key, expiry, offers, location ID, context, decoded token, and raw token.
-
#isValid? ⇒ Boolean
Indicates whether the delegation token is set and has not expired.
-
#refresh ⇒ Object
Refreshes the current token and replace it.
Constructor Details
#initialize(wll, delegationtoken, refreshtoken, sessionkey, expiry, offers, locationid, context, decodedtoken, token) ⇒ ConsentToken
Initialize the ConsentToken module with the WindowsLiveLogin, delegation token, refresh token, session key, expiry, offers, location ID, context, decoded token, and raw token.
598 599 600 601 602 603 604 605 606 607 608 609 610 |
# File 'lib/contacts/windowslivelogin.rb', line 598 def initialize(wll, delegationtoken, refreshtoken, sessionkey, expiry, offers, locationid, context, decodedtoken, token) @wll = wll self.delegationtoken = delegationtoken self.refreshtoken = refreshtoken self.sessionkey = sessionkey self.expiry = expiry self.offers = offers self.locationid = locationid self.context = context self.decodedtoken = decodedtoken self.token = token end |
Instance Attribute Details
#context ⇒ Object
Returns the value of attribute context.
571 572 573 |
# File 'lib/contacts/windowslivelogin.rb', line 571 def context @context end |
#decodedtoken ⇒ Object
Returns the value of attribute decodedtoken.
572 573 574 |
# File 'lib/contacts/windowslivelogin.rb', line 572 def decodedtoken @decodedtoken end |
#delegationtoken ⇒ Object
Returns the value of attribute delegationtoken.
570 571 572 |
# File 'lib/contacts/windowslivelogin.rb', line 570 def delegationtoken @delegationtoken end |
#expiry ⇒ Object
Returns the value of attribute expiry.
570 571 572 |
# File 'lib/contacts/windowslivelogin.rb', line 570 def expiry @expiry end |
#locationid ⇒ Object
Returns the value of attribute locationid.
571 572 573 |
# File 'lib/contacts/windowslivelogin.rb', line 571 def locationid @locationid end |
#offers ⇒ Object
Returns the value of attribute offers.
571 572 573 |
# File 'lib/contacts/windowslivelogin.rb', line 571 def offers @offers end |
#offers_string ⇒ Object
Returns the value of attribute offers_string.
571 572 573 |
# File 'lib/contacts/windowslivelogin.rb', line 571 def offers_string @offers_string end |
#refreshtoken ⇒ Object
Returns the value of attribute refreshtoken.
570 571 572 |
# File 'lib/contacts/windowslivelogin.rb', line 570 def refreshtoken @refreshtoken end |
#sessionkey ⇒ Object
Returns the value of attribute sessionkey.
570 571 572 |
# File 'lib/contacts/windowslivelogin.rb', line 570 def sessionkey @sessionkey end |
#token ⇒ Object
Returns the value of attribute token.
572 573 574 |
# File 'lib/contacts/windowslivelogin.rb', line 572 def token @token end |
Instance Method Details
#isValid? ⇒ Boolean
Indicates whether the delegation token is set and has not expired.
577 578 579 580 |
# File 'lib/contacts/windowslivelogin.rb', line 577 def isValid? return false unless delegationtoken return ((Time.now.to_i-300) < expiry.to_i) end |
#refresh ⇒ Object
Refreshes the current token and replace it. If operation succeeds true is returned to signify success.
586 587 588 589 590 591 |
# File 'lib/contacts/windowslivelogin.rb', line 586 def refresh ct = @wll.refreshConsentToken(self) return false unless ct copy(ct) true end |