Class: Adp::Connection::AccessToken

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config = nil) ⇒ Object



13
14
15
16
17
18
19
20
21
# File 'lib/adp/access_token.rb', line 13

def initialize(config = nil)

  unless config.nil?
    self.token = config["access_token"]
    self.token_type = config["token_type"]
    self.scope = config["scope"]
    self.expires_in = config["expires_in"]
  end
end

Instance Attribute Details

#_expires_inObject

Returns the value of attribute _expires_in.



10
11
12
# File 'lib/adp/access_token.rb', line 10

def _expires_in
  @_expires_in
end

#expires_onObject

Returns the value of attribute expires_on.



8
9
10
# File 'lib/adp/access_token.rb', line 8

def expires_on
  @expires_on
end

#scopeObject

Returns the value of attribute scope.



7
8
9
# File 'lib/adp/access_token.rb', line 7

def scope
  @scope
end

#tokenObject

Returns the value of attribute token.



5
6
7
# File 'lib/adp/access_token.rb', line 5

def token
  @token
end

#token_typeObject

Returns the value of attribute token_type.



6
7
8
# File 'lib/adp/access_token.rb', line 6

def token_type
  @token_type
end

Instance Method Details

#expires_inObject

Returns:

  • (Object)


33
34
35
# File 'lib/adp/access_token.rb', line 33

def expires_in
  return self._expires_in
end

#expires_in=(value) ⇒ Object

Returns:

  • (Object)


24
25
26
27
28
29
30
# File 'lib/adp/access_token.rb', line 24

def expires_in=(value)
  unless value.nil?
    self._expires_in = value
    self.expires_on = Time.new() + self._expires_in
  end
  self.expires_on
end

#is_valid?Boolean

Returns:

  • (Boolean)


37
38
39
# File 'lib/adp/access_token.rb', line 37

def is_valid?
  return true;
end