Class: Jigsaw::Request

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

Constant Summary collapse

SEARCH_COMPANY_URL =
'http://www.jigsaw.com/rest/searchCompany.json'

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(url, options) ⇒ Request

Returns a new instance of Request.



19
20
21
# File 'lib/jigsaw/request.rb', line 19

def initialize(url, options)
  @response = self.class.get(url, :query => options)
end

Instance Attribute Details

#responseObject

Returns the value of attribute response.



7
8
9
# File 'lib/jigsaw/request.rb', line 7

def response
  @response
end

Class Method Details

.search_company(options = {}) ⇒ Object



14
15
16
17
# File 'lib/jigsaw/request.rb', line 14

def self.search_company(options = {})
  request = new(SEARCH_COMPANY_URL, options)
  request.parsed_response
end

Instance Method Details

#parsed_responseObject



23
24
25
# File 'lib/jigsaw/request.rb', line 23

def parsed_response
  @response.parsed_response
end