Class: WhosDatedWho::BingClient

Inherits:
Object
  • Object
show all
Defined in:
lib/whos_dated_who/bing_client.rb

Constant Summary collapse

API_KEY =
ENV['BING_API_KEY'] ||
YAML.load_file( File.expand_path('~/.whos_dated_who.yml'))[:bing_api_key]

Instance Method Summary collapse

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