Class: FolioClient::Organizations

Inherits:
Object
  • Object
show all
Defined in:
lib/folio_client/organizations.rb

Overview

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Organizations

Returns a new instance of Organizations.

Parameters:



11
12
13
# File 'lib/folio_client/organizations.rb', line 11

def initialize(client)
  @client = client
end

Instance Attribute Details

#clientObject

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

Parameters:

  • id (String)

    id for requested storage interface

  • lang (String) (defaults to: "en")

    language code for returned result (defaults to ‘en’)



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

Parameters:

  • query (String) (defaults to: nil)

    an optional query to limit the number of organization interfaces returned

  • limit (Integer) (defaults to: 10000)

    the number of results to return (defaults to 10,000)

  • offset (Integer) (defaults to: 0)

    the offset for results returned (defaults to 0)

  • lang (String) (defaults to: "en")

    language code for returned results (defaults to ‘en’)



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

Parameters:

  • query (String) (defaults to: nil)

    an optional query to limit the number of organizations returned

  • limit (Integer) (defaults to: 10000)

    the number of results to return (defaults to 10,000)

  • offset (Integer) (defaults to: 0)

    the offset for results returned (defaults to 0)

  • lang (String) (defaults to: "en")

    language code for returned results (defaults to ‘en’)



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