Class: Zester::Client

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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_timeoutObject

Returns the value of attribute http_timeout.



8
9
10
# File 'lib/zester/client.rb', line 8

def http_timeout
  @http_timeout
end

#zws_idObject

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

#mortgageObject



31
32
33
# File 'lib/zester/client.rb', line 31

def mortgage
  @mortgage = Zester::Mortgage.new(self)
end

#neighborhoodObject



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

#propertyObject



27
28
29
# File 'lib/zester/client.rb', line 27

def property
  @property = Zester::Property.new(self)
end

#valuationObject



35
36
37
# File 'lib/zester/client.rb', line 35

def valuation
  @valuation = Zester::Valuation.new(self)
end