Sha256: fc32bda75e3bde64fc879f407ad3f47abf7591b738480497bb355f273c7229f9

Contents?: true

Size: 902 Bytes

Versions: 1

Compression:

Stored size: 902 Bytes

Contents

module Binged

  # A client which encapsulates the Bing API
  class Client

    attr_accessor :api_key

    # @param [Hash] options the options to create a client with.
    # @option options [String] :api_key The Bing API key used to make all API calls.
    def initialize(options = {})
      @api_key = options[:api_key] || Binged.api_key
    end

    # Create a web search through Bing
    # 
    # @param [String] query The search term to be sent to Bing
    def web(query='')
      Search::Web.new(self,query)
    end
    
    # Create a image search through Bing
    # 
    # @param [String] query The search term to be sent to Bing
    def image(query='')
      Search::Image.new(self,query)
    end
    
    # Create a video search through Bing
    # 
    # @param [String] query The search term to be sent to Bing
    def video(query='')
      Search::Video.new(self,query)
    end

  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
binged-0.3.0 lib/binged/client.rb