class NDB::FoodReport

Public Class Methods

base_uri() click to toggle source
# File lib/ndb/food_report.rb, line 9
def self.base_uri
  NDB.base_uri + "/reports"
end
retrieve(ndbno:, type: "b") click to toggle source
# File lib/ndb/food_report.rb, line 3
def self.retrieve(ndbno:, type: "b")
  params = "#{base_uri}?ndbno=#{ndbno}&type=#{type}&api_key=#{NDB.api_key}"
  response = Faraday.get(params)
  JSON.parse(response.body)
end