Class: OpenFdaApi::Other

Inherits:
Endpoint show all
Defined in:
lib/open_fda_api/other.rb

Overview

Interact with the Other API Endpoint:

- NSDE
- Substance Data Reports

Instance Attribute Summary

Attributes inherited from Endpoint

#client

Instance Method Summary collapse

Methods inherited from Endpoint

#build_inputs, #build_query, #initialize, #make_request

Constructor Details

This class inherits a constructor from OpenFdaApi::Endpoint

Instance Method Details

#nsde(search: [], sort: [], count: [], skip: 0, limit: 1) ⇒ Object

Returns Response from the API parsed as JSON.

Parameters:

Returns:

  • Response from the API parsed as JSON



14
15
16
17
18
19
# File 'lib/open_fda_api/other.rb', line 14

def nsde(search: [], sort: [], count: [], skip: 0, limit: 1)
  endpoint = "nsde.json"
  inputs   = build_inputs(search: search, sort: sort, count: count, skip: skip, limit: limit)
  query    = build_query(inputs, {}) # TODO: Upload valid fields
  make_request(endpoint, query)
end

#substance_data_reports(search: [], sort: [], count: [], skip: 0, limit: 1) ⇒ Object

Returns Response from the API parsed as JSON.

Parameters:

Returns:

  • Response from the API parsed as JSON



27
28
29
30
31
32
# File 'lib/open_fda_api/other.rb', line 27

def substance_data_reports(search: [], sort: [], count: [], skip: 0, limit: 1)
  endpoint = "substance.json"
  inputs   = build_inputs(search: search, sort: sort, count: count, skip: skip, limit: limit)
  query    = build_query(inputs, {}) # TODO: Upload valid fields
  make_request(endpoint, query)
end