Class: Justa::Authenticator

Inherits:
Object show all
Defined in:
lib/justa/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



63
64
65
66
67
# File 'lib/justa/authenticator.rb', line 63

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

Instance Attribute Details

#clientObject (readonly)

Returns the value of attribute client.



56
57
58
# File 'lib/justa/authenticator.rb', line 56

def client
  @client
end

#keyObject (readonly)

Returns the value of attribute key.



56
57
58
# File 'lib/justa/authenticator.rb', line 56

def key
  @key
end

Instance Method Details

#tokenString

Return client authentication token

Returns:

  • (String)

    Returns cleint authentication token



74
75
76
77
# File 'lib/justa/authenticator.rb', line 74

def token
  refresh_token_if_expired
  @a_token
end