Class: Crossrefapi::Funders

Inherits:
Object
  • Object
show all
Defined in:
lib/crossrefapi/funders.rb

Overview

This class serves as the main entry point for interacting with the CrossRef API funders endpoints.

For detailed API documentation, visit: api.crossref.org/swagger-ui/index.html#/Funders

Example usage:

client = Crossrefapi::Client.new
query = { "query": "red+list" }
response = client.funders.all(query)
pp response

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Funders

Returns a new instance of Funders.



17
18
19
# File 'lib/crossrefapi/funders.rb', line 17

def initialize(client)
  @client = client
end

Instance Method Details

#all(query) ⇒ Object



21
22
23
# File 'lib/crossrefapi/funders.rb', line 21

def all(query)
  @client.get("funders", query)
end

#by_id(id) ⇒ Object



25
26
27
# File 'lib/crossrefapi/funders.rb', line 25

def by_id(id)
  @client.get("funders/#{id}")
end

#by_id_works(id, query = {}) ⇒ Object



29
30
31
# File 'lib/crossrefapi/funders.rb', line 29

def by_id_works(id, query = {})
  @client.get("funders/#{id}/works", query)
end