Class: Binged::Client
- Inherits:
-
Object
- Object
- Binged::Client
- Defined in:
- lib/binged/client.rb
Overview
A client which encapsulates the Bing API
Instance Attribute Summary collapse
-
#api_key ⇒ Object
Returns the value of attribute api_key.
Instance Method Summary collapse
-
#image(query = '') ⇒ Object
Create a image search through Bing.
-
#initialize(options = {}) ⇒ Client
constructor
A new instance of Client.
-
#video(query = '') ⇒ Object
Create a video search through Bing.
-
#web(query = '') ⇒ Object
Create a web search through Bing.
Constructor Details
#initialize(options = {}) ⇒ Client
Returns a new instance of Client.
10 11 12 |
# File 'lib/binged/client.rb', line 10 def initialize( = {}) @api_key = [:api_key] || Binged.api_key end |
Instance Attribute Details
#api_key ⇒ Object
Returns the value of attribute api_key.
6 7 8 |
# File 'lib/binged/client.rb', line 6 def api_key @api_key end |
Instance Method Details
#image(query = '') ⇒ Object
Create a image search through Bing
24 25 26 |
# File 'lib/binged/client.rb', line 24 def image(query='') Search::Image.new(self,query) end |
#video(query = '') ⇒ Object
Create a video search through Bing
31 32 33 |
# File 'lib/binged/client.rb', line 31 def video(query='') Search::Video.new(self,query) end |
#web(query = '') ⇒ Object
Create a web search through Bing
17 18 19 |
# File 'lib/binged/client.rb', line 17 def web(query='') Search::Web.new(self,query) end |