Class: Shipay::Authenticator

Inherits:
Object
  • Object
show all
Defined in:
lib/shipay/authenticator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Authenticator

Initialize Authenticator Class

Parameters:

  • client (Client)

    Receives Client instance to initialize authenticator



62
63
64
65
66
# File 'lib/shipay/authenticator.rb', line 62

def initialize(client)
  @client = client
  @key = client.key
  authenticate
end

Instance Attribute Details

#clientObject (readonly)

Returns the value of attribute client.



55
56
57
# File 'lib/shipay/authenticator.rb', line 55

def client
  @client
end

#keyObject (readonly)

Returns the value of attribute key.



55
56
57
# File 'lib/shipay/authenticator.rb', line 55

def key
  @key
end

Instance Method Details

#tokenString

Return client authentication token

Returns:

  • (String)

    Returns cleint authentication token



73
74
75
76
# File 'lib/shipay/authenticator.rb', line 73

def token
  refresh_token_if_expired
  @a_token
end