Class: Updox::Models::Auth
- Inherits:
-
Hashie::Trash
- Object
- Hashie::Trash
- Updox::Models::Auth
- Defined in:
- lib/updox/models/auth.rb
Constant Summary collapse
- AUTH_NONE =
[]
- AUTH_APP =
[:applicationId, :applicationPassword]
- AUTH_ACCT =
AUTH_APP + [:accountId]
- AUTH_FULL =
AUTH_ACCT + [:userId]
- PING_ENDPOINT =
'/Ping'
- PING_APP_ENDPOINT =
PING_ENDPOINT + 'WithApplicationAuth'
- PING_ACCT_ENDPOINT =
PING_ENDPOINT + 'WithAccountAuth'
- PING_FULL_ENDPOINT =
PING_ENDPOINT + 'WithAuth'
Instance Method Summary collapse
- #ping ⇒ Object
- #ping_with_account_auth ⇒ Object
- #ping_with_application_auth ⇒ Object
- #ping_with_full_auth ⇒ Object
- #to_h ⇒ Object
Instance Method Details
#ping ⇒ Object
28 29 30 |
# File 'lib/updox/models/auth.rb', line 28 def ping Model.request(endpoint: PING_ENDPOINT, auth: self) end |
#ping_with_account_auth ⇒ Object
36 37 38 |
# File 'lib/updox/models/auth.rb', line 36 def ping_with_account_auth Model.request(endpoint: PING_ACCT_ENDPOINT, auth: self, required_auths: AUTH_ACCT) end |
#ping_with_application_auth ⇒ Object
32 33 34 |
# File 'lib/updox/models/auth.rb', line 32 def ping_with_application_auth Model.request(endpoint: PING_APP_ENDPOINT, auth: self, required_auths: AUTH_APP) end |
#ping_with_full_auth ⇒ Object
40 41 42 |
# File 'lib/updox/models/auth.rb', line 40 def ping_with_full_auth Model.request(endpoint: PING_FULL_ENDPOINT, auth: self, required_auths: AUTH_FULL) end |
#to_h ⇒ Object
24 25 26 |
# File 'lib/updox/models/auth.rb', line 24 def to_h { auth: super.to_h } end |