Class: Zara4::API::Communication::Authentication::Authenticator
- Inherits:
-
Object
- Object
- Zara4::API::Communication::Authentication::Authenticator
- Defined in:
- lib/zara4/api/communication/authentication/authenticator.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#client_id ⇒ Object
Returns the value of attribute client_id.
-
#client_secret ⇒ Object
Returns the value of attribute client_secret.
Instance Method Summary collapse
-
#initialize(client_id, client_secret) ⇒ Authenticator
constructor
Constructor.
-
#with_image_processing ⇒ Object
Add image processing to the Authenticator scope.
-
#with_usage ⇒ Object
Add reading account usage to the Authenticator scope.
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_id ⇒ Object
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_secret ⇒ Object
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_processing ⇒ Object
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_usage ⇒ Object
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 |