Class: Peddler::Token
- Inherits:
-
Object
- Object
- Peddler::Token
- Defined in:
- lib/peddler/token.rb
Overview
Requests refresh and access tokens that authorize your application to take actions on behalf of a selling partner.
The refresh token allows you to generate access tokens. Access tokens expire one hour after they are issued.
Defined Under Namespace
Classes: Error
Constant Summary collapse
- URL =
"https://api.amazon.com/auth/o2/token"
Instance Attribute Summary collapse
-
#client_id ⇒ Object
readonly
Returns the value of attribute client_id.
-
#client_secret ⇒ Object
readonly
Returns the value of attribute client_secret.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(client_id: ENV["LWA_CLIENT_ID"], client_secret: ENV["LWA_CLIENT_SECRET"], **options) ⇒ Token
constructor
A new instance of Token.
- #request ⇒ Object
Constructor Details
#initialize(client_id: ENV["LWA_CLIENT_ID"], client_secret: ENV["LWA_CLIENT_SECRET"], **options) ⇒ Token
Returns a new instance of Token.
31 32 33 34 35 |
# File 'lib/peddler/token.rb', line 31 def initialize(client_id: ENV["LWA_CLIENT_ID"], client_secret: ENV["LWA_CLIENT_SECRET"], **) @client_id = client_id @client_secret = client_secret @options = end |
Instance Attribute Details
#client_id ⇒ Object (readonly)
Returns the value of attribute client_id.
23 24 25 |
# File 'lib/peddler/token.rb', line 23 def client_id @client_id end |
#client_secret ⇒ Object (readonly)
Returns the value of attribute client_secret.
23 24 25 |
# File 'lib/peddler/token.rb', line 23 def client_secret @client_secret end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
23 24 25 |
# File 'lib/peddler/token.rb', line 23 def @options end |
Class Method Details
.request ⇒ Object
26 27 28 |
# File 'lib/peddler/token.rb', line 26 def request(...) new(...).request end |