Module: CoverMyMeds::Tokens
Constant Summary collapse
- CURRENT_VERSION =
1
Instance Method Summary collapse
- #create_access_token(request_id, version = CURRENT_VERSION) ⇒ Object
- #revoke_access_token?(token_id, version = CURRENT_VERSION) ⇒ Boolean
-
#tokens_path ⇒ Object
Override the meta-programming in this oddball case.
Methods included from HostAndPath
Instance Method Details
#create_access_token(request_id, version = CURRENT_VERSION) ⇒ Object
7 8 9 10 11 |
# File 'lib/cover_my_meds/client/tokens.rb', line 7 def create_access_token request_id, version=CURRENT_VERSION params = {'request_ids[]' => request_id, v: version} data = tokens_request POST, params: params Hashie::Mash.new data['tokens'].first end |
#revoke_access_token?(token_id, version = CURRENT_VERSION) ⇒ Boolean
13 14 15 16 |
# File 'lib/cover_my_meds/client/tokens.rb', line 13 def revoke_access_token? token_id, version=CURRENT_VERSION params = { v: version } tokens_request DELETE, path: token_id, params: params end |
#tokens_path ⇒ Object
Override the meta-programming in this oddball case
19 20 21 |
# File 'lib/cover_my_meds/client/tokens.rb', line 19 def tokens_path @tokens_path || "/requests/tokens/" end |