Class: ConsolidatedScreeningList::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/consolidated_screening_list/client.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Client

Returns a new instance of Client.



11
12
13
# File 'lib/consolidated_screening_list/client.rb', line 11

def initialize(options = {})
  @api_key = options[:api_key] || ENV["TRADE_API_KEY"]
end

Instance Attribute Details

#api_keyObject (readonly)

Returns the value of attribute api_key.



9
10
11
# File 'lib/consolidated_screening_list/client.rb', line 9

def api_key
  @api_key
end

Class Method Details

.search(options = {}) ⇒ Object



4
5
6
# File 'lib/consolidated_screening_list/client.rb', line 4

def search(options = {})
  Client.new.search(options)
end

Instance Method Details

#search(params = {}) ⇒ Object



15
16
17
# File 'lib/consolidated_screening_list/client.rb', line 15

def search(params = {})
  parse_response Query.new(params, api_key).call
end