class ConsolidatedScreeningList::Client
Attributes
api_key[R]
Public Class Methods
new(options = {})
click to toggle source
# File lib/consolidated_screening_list/client.rb, line 11 def initialize(options = {}) @api_key = options[:api_key] || ENV["TRADE_API_KEY"] end
search(options = {})
click to toggle source
# File lib/consolidated_screening_list/client.rb, line 4 def search(options = {}) Client.new.search(options) end
Public Instance Methods
search(params = {})
click to toggle source
# File lib/consolidated_screening_list/client.rb, line 15 def search(params = {}) parse_response Query.new(params, api_key).call end
Private Instance Methods
parse_response(response)
click to toggle source
# File lib/consolidated_screening_list/client.rb, line 21 def parse_response(response) JSON.parse(response)["results"].map { |data| Result.new(data) } end