Class: RBing

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/rbing.rb

Overview

> “1 furlong = 40 rods”

Defined Under Namespace

Classes: ResponseData

Constant Summary collapse

BASE_OPTIONS =
[:version, :market, :adult, :query, :appid, :sources]
QUERY_KEYWORDS =
[:site, :language, :contains, :filetype, :inanchor, :inbody, :intitle, :ip, :loc, :location, :prefer, :feed, :hasfeed, :url]
SOURCES =
%w(Ad Image InstantAnswer News Phonebook RelatedSearch Spell Web)

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#instance_optionsObject

Returns the value of attribute instance_options.



80
81
82
# File 'lib/rbing.rb', line 80

def instance_options
  @instance_options
end

Instance Method Details

#search(source, query, options = {}) ⇒ Object

issues a search for query in source



112
113
114
115
# File 'lib/rbing.rb', line 112

def search(source, query, options={})
  rsp = self.class.get('', options_for(source, query, options))
  ResponseData.new(rsp['SearchResponse']) if rsp
end