Class: Jbr::Mock::OAuth
Overview
Credentials that answer from Jbr.mock instead of Jobber.
Constant Summary
Constants inherited from OAuth
Instance Attribute Summary
Attributes inherited from OAuth
#access_token, #account_id, #expires_at, #invalid_at, #refresh_token
Class Method Summary collapse
-
.post(_) ⇒ Hash
Canned credentials, unless the app asked for a refusal.
Instance Method Summary collapse
- #account ⇒ Object
-
#delete ⇒ Object
Revoking a mocked token asks nobody.
-
#invoices ⇒ Object
The mocked resources these credentials read and write.
- #jobs ⇒ Object
- #quotes ⇒ Object
- #requests ⇒ Object
- #visits ⇒ Object
Methods inherited from OAuth
client_id, client_secret, #clients, create, #initialize, #query
Constructor Details
This class inherits a constructor from Jbr::OAuth
Class Method Details
.post(_) ⇒ Hash
Returns canned credentials, unless the app asked for a refusal.
16 17 18 19 20 |
# File 'lib/jbr/mock/oauth.rb', line 16 def self.post(_) raise Error, Jbr.mock.oauth_error if Jbr.mock.oauth_error { access_token: 'mock-token', refresh_token: 'mock-token', expires_at: (Time.now + 3600) } end |
Instance Method Details
#account ⇒ Object
9 |
# File 'lib/jbr/mock/oauth.rb', line 9 def account = Mock::Account.new oauth: self |
#delete ⇒ Object
Revoking a mocked token asks nobody.
13 |
# File 'lib/jbr/mock/oauth.rb', line 13 def delete; end |
#invoices ⇒ Object
The mocked resources these credentials read and write.
5 |
# File 'lib/jbr/mock/oauth.rb', line 5 def invoices = Mock::Invoice.new(oauth: self) |