Class: OpenFdaApi::Tobacco

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

Overview

Interact with the Tobacco API Endpoint:

- Problem 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

#problem_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



13
14
15
16
17
18
# File 'lib/open_fda_api/tobacco.rb', line 13

def problem_reports(search: [], sort: [], count: [], skip: 0, limit: 1)
  endpoint = "problem.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