Class: Address::Io::City
Constant Summary
Constants included
from ApiResource
ApiResource::BASE_URL
Class Method Summary
collapse
Instance Method Summary
collapse
#api_request, #encode, included, #recursive_symbolize_keys, #url_encode
Class Method Details
.list_all(params = nil) ⇒ Object
13
14
15
16
17
18
19
20
|
# File 'lib/address/io/city.rb', line 13
def self.list_all(params=nil)
if params && params[:state]
@state = params[:state]
api_request(url, :get, params)
else
nil
end
end
|
.url ⇒ Object
5
6
7
|
# File 'lib/address/io/city.rb', line 5
def self.url
"/v1/states/#{@state}/cities"
end
|
Instance Method Details
#url ⇒ Object
9
10
11
|
# File 'lib/address/io/city.rb', line 9
def url
"#{self.class.url}/#{self.id}"
end
|