Class: WhosDatedWho::BingClient
- Inherits:
-
Object
- Object
- WhosDatedWho::BingClient
- Defined in:
- lib/whos_dated_who/bing_client.rb
Constant Summary collapse
- API_KEY =
ENV['BING_API_KEY'] || YAML.load_file( File.('~/.whos_dated_who.yml'))[:bing_api_key]
Instance Method Summary collapse
-
#initialize(type = 'Web', num_results = 10, api_key = API_KEY) ⇒ BingClient
constructor
A new instance of BingClient.
- #search(query) ⇒ Object
Constructor Details
#initialize(type = 'Web', num_results = 10, api_key = API_KEY) ⇒ BingClient
Returns a new instance of BingClient.
7 8 9 10 |
# File 'lib/whos_dated_who/bing_client.rb', line 7 def initialize(type='Web', num_results=10, api_key=API_KEY) @api_key = api_key @client = Bing.new(@api_key, num_results, type) end |
Instance Method Details
#search(query) ⇒ Object
12 13 14 |
# File 'lib/whos_dated_who/bing_client.rb', line 12 def search(query) @client.search(query) end |