Class: PayPal::AccessToken

Inherits:
Object
  • Object
show all
Defined in:
lib/core/access_token.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ AccessToken

Returns a new instance of AccessToken.



5
6
7
8
9
10
# File 'lib/core/access_token.rb', line 5

def initialize(options)
  @access_token = options.access_token
  @token_type = options.token_type
  @expires_in = options.expires_in
  @date_created = Time.now
end

Instance Attribute Details

#access_tokenObject

Returns the value of attribute access_token.



3
4
5
# File 'lib/core/access_token.rb', line 3

def access_token
  @access_token
end

#date_createdObject

Returns the value of attribute date_created.



3
4
5
# File 'lib/core/access_token.rb', line 3

def date_created
  @date_created
end

#expires_inObject

Returns the value of attribute expires_in.



3
4
5
# File 'lib/core/access_token.rb', line 3

def expires_in
  @expires_in
end

#token_typeObject

Returns the value of attribute token_type.



3
4
5
# File 'lib/core/access_token.rb', line 3

def token_type
  @token_type
end

Instance Method Details

#authorizationStringObject



16
17
18
# File 'lib/core/access_token.rb', line 16

def authorizationString
  return "#{@token_type} #{@access_token}"
end

#isExpiredObject



12
13
14
# File 'lib/core/access_token.rb', line 12

def isExpired
  return Time.now > @date_created + @expires_in
end