Class: Zara4::API::Communication::Grant::PasswordGrant
- Inherits:
-
GrantRequest
- Object
- GrantRequest
- Zara4::API::Communication::Grant::PasswordGrant
- Defined in:
- lib/zara4/api/communication/grant/password_grant.rb
Instance Attribute Summary collapse
-
#password ⇒ Object
Returns the value of attribute password.
-
#username ⇒ Object
Returns the value of attribute username.
Attributes inherited from GrantRequest
#client_id, #client_secret, #scopes
Instance Method Summary collapse
-
#data ⇒ Object
Data to be sent when fetching grant tokens.
-
#grant_type ⇒ Object
The type of this grant.
-
#initialize(client_id, client_secret, username, password, scopes) ⇒ PasswordGrant
constructor
A new instance of PasswordGrant.
Methods inherited from GrantRequest
#get_tokens, #with_image_processing, #with_usage
Constructor Details
#initialize(client_id, client_secret, username, password, scopes) ⇒ PasswordGrant
Returns a new instance of PasswordGrant.
7 8 9 10 11 |
# File 'lib/zara4/api/communication/grant/password_grant.rb', line 7 def initialize(client_id, client_secret, username, password, scopes) super(client_id, client_secret, scopes) @username = username @password = password end |
Instance Attribute Details
#password ⇒ Object
Returns the value of attribute password.
4 5 6 |
# File 'lib/zara4/api/communication/grant/password_grant.rb', line 4 def password @password end |
#username ⇒ Object
Returns the value of attribute username.
4 5 6 |
# File 'lib/zara4/api/communication/grant/password_grant.rb', line 4 def username @username end |
Instance Method Details
#data ⇒ Object
Data to be sent when fetching grant tokens.
25 26 27 28 29 30 |
# File 'lib/zara4/api/communication/grant/password_grant.rb', line 25 def data data = super.data data['username'] = @username data['password'] = @password return data end |
#grant_type ⇒ Object
The type of this grant.
17 18 19 |
# File 'lib/zara4/api/communication/grant/password_grant.rb', line 17 def grant_type return 'password' end |