Module: Zotero::Syncing
Overview
Syncing and API key verification methods.
This module can be included in both Client and Library classes. Classes including this module must implement #api_client which returns the object that responds to #make_get_request.
Instance Method Summary collapse
-
#api_client ⇒ Object
private
Returns the object that handles API requests.
-
#deleted_items(since: nil) ⇒ Hash
Get items that have been deleted from this library.
-
#user_groups(user_id, format: "versions") ⇒ Hash, Array
Get groups for a specific user.
-
#verify_api_key ⇒ Hash
Verify that the current API key is valid.
Instance Method Details
#api_client ⇒ Object (private)
Returns the object that handles API requests. Override in including classes if needed.
41 42 43 |
# File 'lib/zotero/syncing.rb', line 41 def api_client @client || self end |
#deleted_items(since: nil) ⇒ Hash
Get items that have been deleted from this library. Only available when included in Library.
31 32 33 |
# File 'lib/zotero/syncing.rb', line 31 def deleted_items(since: nil) api_client.make_get_request("#{@base_path}/deleted", params: { since: since }.compact) end |
#user_groups(user_id, format: "versions") ⇒ Hash, Array
Get groups for a specific user.
22 23 24 |
# File 'lib/zotero/syncing.rb', line 22 def user_groups(user_id, format: "versions") api_client.make_get_request("/users/#{user_id}/groups", params: { format: format }) end |
#verify_api_key ⇒ Hash
Verify that the current API key is valid.
13 14 15 |
# File 'lib/zotero/syncing.rb', line 13 def verify_api_key api_client.make_get_request("/keys/current") end |