Class: Zester::Client
Instance Attribute Summary collapse
-
#http_timeout ⇒ Object
Returns the value of attribute http_timeout.
-
#zws_id ⇒ Object
Returns the value of attribute zws_id.
Instance Method Summary collapse
-
#initialize(zws_id, http_timeout = nil) ⇒ Client
constructor
A new instance of Client.
- #mortgage ⇒ Object
- #neighborhood ⇒ Object
- #perform_get(endpoint, params = {}) ⇒ Object
- #property ⇒ Object
- #valuation ⇒ Object
Constructor Details
#initialize(zws_id, http_timeout = nil) ⇒ Client
Returns a new instance of Client.
10 11 12 13 14 |
# File 'lib/zester/client.rb', line 10 def initialize(zws_id, http_timeout = nil) self.zws_id = zws_id self.http_timeout = http_timeout self.class.default_params "zws-id" => zws_id end |
Instance Attribute Details
#http_timeout ⇒ Object
Returns the value of attribute http_timeout.
8 9 10 |
# File 'lib/zester/client.rb', line 8 def http_timeout @http_timeout end |
#zws_id ⇒ Object
Returns the value of attribute zws_id.
8 9 10 |
# File 'lib/zester/client.rb', line 8 def zws_id @zws_id end |
Instance Method Details
#mortgage ⇒ Object
31 32 33 |
# File 'lib/zester/client.rb', line 31 def mortgage @mortgage = Zester::Mortgage.new(self) end |
#neighborhood ⇒ Object
39 40 41 |
# File 'lib/zester/client.rb', line 39 def neighborhood @neighborhood = Zester::Neighborhood.new(self) end |
#perform_get(endpoint, params = {}) ⇒ Object
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/zester/client.rb', line 16 def perform_get(endpoint, params = {}) http_params = {} unless params.empty? http_params[:query] = params end unless self.http_timeout.nil? http_params[:timeout] = self.http_timeout end self.class.get("/#{endpoint}.htm", http_params) end |