Class: FolioClient::Organizations
- Inherits:
-
Object
- Object
- FolioClient::Organizations
- Defined in:
- lib/folio_client/organizations.rb
Overview
Query organization records in Folio; see s3.amazonaws.com/foliodocs/api/mod-organizations/p/organizations.html s3.amazonaws.com/foliodocs/api/mod-organizations-storage/p/interface.html
Instance Attribute Summary collapse
-
#client ⇒ Object
Returns the value of attribute client.
Instance Method Summary collapse
- #fetch_interface_details(id:, lang: "en") ⇒ Object
- #fetch_interface_list(query: nil, limit: 10000, offset: 0, lang: "en") ⇒ Object
- #fetch_list(query: nil, limit: 10000, offset: 0, lang: "en") ⇒ Object
-
#initialize(client) ⇒ Organizations
constructor
A new instance of Organizations.
Constructor Details
#initialize(client) ⇒ Organizations
Returns a new instance of Organizations.
11 12 13 |
# File 'lib/folio_client/organizations.rb', line 11 def initialize(client) @client = client end |
Instance Attribute Details
#client ⇒ Object
Returns the value of attribute client.
8 9 10 |
# File 'lib/folio_client/organizations.rb', line 8 def client @client end |
Instance Method Details
#fetch_interface_details(id:, lang: "en") ⇒ Object
37 38 39 40 41 |
# File 'lib/folio_client/organizations.rb', line 37 def fetch_interface_details(id:, lang: "en") client.get("/organizations-storage/interfaces/#{id}", { lang: lang }) end |
#fetch_interface_list(query: nil, limit: 10000, offset: 0, lang: "en") ⇒ Object
29 30 31 32 33 |
# File 'lib/folio_client/organizations.rb', line 29 def fetch_interface_list(query: nil, limit: 10000, offset: 0, lang: "en") params = {limit: limit, offset: offset, lang: lang} params[:query] = query if query client.get("/organizations-storage/interfaces", params) end |
#fetch_list(query: nil, limit: 10000, offset: 0, lang: "en") ⇒ Object
19 20 21 22 23 |
# File 'lib/folio_client/organizations.rb', line 19 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("/organizations/organizations", params) end |