Class: Ward

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/ward.rb,
lib/ward/ward_data.rb

Defined Under Namespace

Classes: Data

Instance Method Summary (collapse)

Constructor Details

- (Ward) initialize(username = nil, api_key = nil)

A new instance of Ward



11
12
13
14
# File 'lib/ward.rb', line 11

def initialize(username = nil, api_key = nil)
  @username = username
  @api_key  = api_key
end

Instance Method Details

- (Object) find(address)

Find the ward for a given address.



17
18
19
20
21
22
23
# File 'lib/ward.rb', line 17

def find(address)
  # Geocode the given address.
  geocode address

  ward = Data.new(data)
  ward.to_hash
end