Class: Pickpoint::TokenPair

Inherits:
Struct
  • Object
show all
Defined in:
lib/pickpoint/mint.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#access_tokenObject

Returns the value of attribute access_token

Returns:

  • (Object)

    the current value of access_token



6
7
8
# File 'lib/pickpoint/mint.rb', line 6

def access_token
  @access_token
end

#expires_atObject

Returns the value of attribute expires_at

Returns:

  • (Object)

    the current value of expires_at



6
7
8
# File 'lib/pickpoint/mint.rb', line 6

def expires_at
  @expires_at
end

#expires_inObject

Returns the value of attribute expires_in

Returns:

  • (Object)

    the current value of expires_in



6
7
8
# File 'lib/pickpoint/mint.rb', line 6

def expires_in
  @expires_in
end

#refresh_tokenObject

Returns the value of attribute refresh_token

Returns:

  • (Object)

    the current value of refresh_token



6
7
8
# File 'lib/pickpoint/mint.rb', line 6

def refresh_token
  @refresh_token
end

#scopesObject

Returns the value of attribute scopes

Returns:

  • (Object)

    the current value of scopes



6
7
8
# File 'lib/pickpoint/mint.rb', line 6

def scopes
  @scopes
end

Class Method Details

.from_hash(d) ⇒ Object



10
11
12
13
14
15
16
17
18
19
# File 'lib/pickpoint/mint.rb', line 10

def self.from_hash(d)
  d = d.transform_keys(&:to_s)
  new(
    access_token: (d["accessToken"] || "").to_s,
    refresh_token: (d["refreshToken"] || "").to_s,
    expires_at: (d["expiresAt"] || 0).to_i,
    expires_in: (d["expiresIn"] || 0).to_i,
    scopes: Array(d["scopes"])
  )
end