Class: Zester::Neighborhood

Inherits:
Resource show all
Defined in:
lib/zester/neighborhood.rb

Instance Attribute Summary

Attributes inherited from Resource

#client

Instance Method Summary collapse

Methods inherited from Resource

#get_results, #initialize

Constructor Details

This class inherits a constructor from Zester::Resource

Instance Method Details

#demographics(params = {}) ⇒ Object



4
5
6
7
8
9
10
11
12
# File 'lib/zester/neighborhood.rb', line 4

def demographics(params = {})
  if params['regionid'].nil? && 
    (params['state'].nil? || params['city'].nil?) && 
    (params['city'].nil? || params['neighborhood'].nil?) && 
    params['zip'].nil?
    raise ArgumentError, "At least rid or state & city or city & neighborhood or zip is required"
  end
  get_results('GetDemographics', :demographics, params)
end

#region_chart(params = {}) ⇒ Object



21
22
23
24
# File 'lib/zester/neighborhood.rb', line 21

def region_chart(params = {})
  params['unit-type'] ||= 'dollar'
  get_results('GetRegionChart', :regionchart, params)
end

#region_children(params = {}) ⇒ Object



14
15
16
17
18
19
# File 'lib/zester/neighborhood.rb', line 14

def region_children(params = {})
  if params['regionId'].nil? && params['state'].nil?
    raise ArgumentError, "At least region_id or state is required"
  end
  get_results('GetRegionChildren', :regionchildren, params)
end