Class: WhosDatedWho::BingClient
- Inherits:
-
Object
- Object
- WhosDatedWho::BingClient
- Defined in:
- lib/whos_dated_who/bing_client.rb
Instance Method Summary collapse
-
#initialize(type = 'Web', num_results = 10, api_key = nil) ⇒ BingClient
constructor
A new instance of BingClient.
- #search(query) ⇒ Object
Constructor Details
#initialize(type = 'Web', num_results = 10, api_key = nil) ⇒ BingClient
Returns a new instance of BingClient.
4 5 6 7 |
# File 'lib/whos_dated_who/bing_client.rb', line 4 def initialize(type = 'Web', num_results = 10, api_key = nil) @api_key = api_key || ENV['BING_API_KEY'] || config[:bing_api_key] @client = Bing.new(@api_key, num_results, type) end |
Instance Method Details
#search(query) ⇒ Object
9 10 11 |
# File 'lib/whos_dated_who/bing_client.rb', line 9 def search(query) @client.search(query) end |