Class: Zara4::API::Communication::Authentication::Authenticator

Inherits:
Object
  • Object
show all
Defined in:
lib/zara4/api/communication/authentication/authenticator.rb

Direct Known Subclasses

ApplicationAuthenticator, UserAuthenticator

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client_id, client_secret) ⇒ Authenticator

Constructor



9
10
11
12
13
# File 'lib/zara4/api/communication/authentication/authenticator.rb', line 9

def initialize(client_id, client_secret)
  @client_id     = client_id
  @client_secret = client_secret
  @scopes        = [];
end

Instance Attribute Details

#client_idObject

Returns the value of attribute client_id.



4
5
6
# File 'lib/zara4/api/communication/authentication/authenticator.rb', line 4

def client_id
  @client_id
end

#client_secretObject

Returns the value of attribute client_secret.



4
5
6
# File 'lib/zara4/api/communication/authentication/authenticator.rb', line 4

def client_secret
  @client_secret
end

Instance Method Details

#with_image_processingObject

Add image processing to the Authenticator scope.



19
20
21
22
# File 'lib/zara4/api/communication/authentication/authenticator.rb', line 19

def with_image_processing
  @scopes.push('image-processing')
  return self
end

#with_usageObject

Add reading account usage to the Authenticator scope.



28
29
30
31
# File 'lib/zara4/api/communication/authentication/authenticator.rb', line 28

def with_usage
  @scopes.push('usage')
  return self
end