Class: FolioClient::Users
- Inherits:
-
Object
- Object
- FolioClient::Users
- Defined in:
- lib/folio_client/users.rb
Overview
Query user records in Folio; see s3.amazonaws.com/foliodocs/api/mod-users/r/users.html
Instance Attribute Summary collapse
-
#client ⇒ Object
Returns the value of attribute client.
Instance Method Summary collapse
- #fetch_list(query: nil, limit: 10000, offset: 0, lang: "en") ⇒ Object
- #fetch_user_details(id:, lang: "en") ⇒ Object
-
#initialize(client) ⇒ Users
constructor
A new instance of Users.
Constructor Details
#initialize(client) ⇒ Users
Returns a new instance of Users.
10 11 12 |
# File 'lib/folio_client/users.rb', line 10 def initialize(client) @client = client end |
Instance Attribute Details
#client ⇒ Object
Returns the value of attribute client.
7 8 9 |
# File 'lib/folio_client/users.rb', line 7 def client @client end |
Instance Method Details
#fetch_list(query: nil, limit: 10000, offset: 0, lang: "en") ⇒ Object
18 19 20 21 22 |
# File 'lib/folio_client/users.rb', line 18 def fetch_list(query: nil, limit: 10000, offset: 0, lang: "en") params = {limit: limit, offset: offset, lang: lang} params[:query] = query if query client.get("/users", params) end |
#fetch_user_details(id:, lang: "en") ⇒ Object
26 27 28 29 30 |
# File 'lib/folio_client/users.rb', line 26 def fetch_user_details(id:, lang: "en") client.get("/users/#{id}", { lang: lang }) end |