Class: BingHelper::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/bing-helper/response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ Response

Returns a new instance of Response.



21
22
23
# File 'lib/bing-helper/response.rb', line 21

def initialize(response)
  @raw_response = response
end

Instance Attribute Details

#raw_responseObject (readonly)

Returns the value of attribute raw_response.



4
5
6
# File 'lib/bing-helper/response.rb', line 4

def raw_response
  @raw_response
end

Instance Method Details

#queryObject



17
18
19
# File 'lib/bing-helper/response.rb', line 17

def query
  @query ||= raw_response["SearchResponse"]["Query"]
end

#versionObject



13
14
15
# File 'lib/bing-helper/response.rb', line 13

def version
  @version ||= raw_response["SearchResponse"]["Version"]
end