Class: Geocodio::Address
- Inherits:
-
Object
- Object
- Geocodio::Address
- Includes:
- Canadian
- Defined in:
- lib/geocodio/address.rb
Instance Attribute Summary collapse
-
#accuracy ⇒ Float
readonly
How accurate geocod.io deemed this result to be given the original query.
-
#accuracy_type ⇒ Float
readonly
How accurate geocod.io deemed this result to be given the original query.
-
#city ⇒ Object
readonly
Returns the value of attribute city.
-
#congressional_districts ⇒ Object
readonly
Returns the value of attribute congressional_districts.
-
#county ⇒ Object
readonly
Returns the value of attribute county.
-
#elementary_school_district ⇒ Object
readonly
Returns the value of attribute elementary_school_district.
-
#formatted_street ⇒ Object
readonly
Returns the value of attribute formatted_street.
-
#house_districts ⇒ Object
readonly
Returns the value of attribute house_districts.
-
#latitude ⇒ Object
(also: #lat)
readonly
Returns the value of attribute latitude.
-
#longitude ⇒ Object
(also: #lng)
readonly
Returns the value of attribute longitude.
-
#number ⇒ Object
readonly
Returns the value of attribute number.
-
#postdirectional ⇒ Object
readonly
Returns the value of attribute postdirectional.
-
#predirectional ⇒ Object
readonly
Returns the value of attribute predirectional.
-
#secondary_school_district ⇒ Object
readonly
Returns the value of attribute secondary_school_district.
-
#senate_districts ⇒ Object
readonly
Returns the value of attribute senate_districts.
-
#source ⇒ Float
readonly
How accurate geocod.io deemed this result to be given the original query.
-
#state ⇒ Object
readonly
Returns the value of attribute state.
-
#street ⇒ Object
readonly
Returns the value of attribute street.
-
#suffix ⇒ Object
readonly
Returns the value of attribute suffix.
-
#timezone ⇒ Object
readonly
Returns the value of attribute timezone.
-
#unified_school_district ⇒ Object
readonly
Returns the value of attribute unified_school_district.
-
#zip ⇒ Object
readonly
Returns the value of attribute zip.
Attributes included from Canadian
Instance Method Summary collapse
-
#initialize(payload = {}) ⇒ Address
constructor
A new instance of Address.
-
#to_s ⇒ String
Formats the address in the standard way.
Methods included from Canadian
#canadian?, #set_canadian_fields
Constructor Details
#initialize(payload = {}) ⇒ Address
Returns a new instance of Address.
28 29 30 31 32 33 34 35 36 37 |
# File 'lib/geocodio/address.rb', line 28 def initialize(payload = {}) set_attributes(payload['address_components']) if payload['address_components'] set_coordinates(payload['location']) if payload['location'] set_additional_fields(payload['fields']) if payload['fields'] @source = payload['source'] @accuracy = payload['accuracy'] @accuracy_type = payload['accuracy_type'] @formatted_address = payload['formatted_address'] end |
Instance Attribute Details
#accuracy ⇒ Float (readonly)
How accurate geocod.io deemed this result to be given the original query.
26 27 28 |
# File 'lib/geocodio/address.rb', line 26 def accuracy @accuracy end |
#accuracy_type ⇒ Float (readonly)
How accurate geocod.io deemed this result to be given the original query.
26 27 28 |
# File 'lib/geocodio/address.rb', line 26 def accuracy_type @accuracy_type end |
#city ⇒ Object (readonly)
Returns the value of attribute city.
10 11 12 |
# File 'lib/geocodio/address.rb', line 10 def city @city end |
#congressional_districts ⇒ Object (readonly)
Returns the value of attribute congressional_districts.
17 18 19 |
# File 'lib/geocodio/address.rb', line 17 def congressional_districts @congressional_districts end |
#county ⇒ Object (readonly)
Returns the value of attribute county.
10 11 12 |
# File 'lib/geocodio/address.rb', line 10 def county @county end |
#elementary_school_district ⇒ Object (readonly)
Returns the value of attribute elementary_school_district.
17 18 19 |
# File 'lib/geocodio/address.rb', line 17 def elementary_school_district @elementary_school_district end |
#formatted_street ⇒ Object (readonly)
Returns the value of attribute formatted_street.
10 11 12 |
# File 'lib/geocodio/address.rb', line 10 def formatted_street @formatted_street end |
#house_districts ⇒ Object (readonly)
Returns the value of attribute house_districts.
17 18 19 |
# File 'lib/geocodio/address.rb', line 17 def house_districts @house_districts end |
#latitude ⇒ Object (readonly) Also known as: lat
Returns the value of attribute latitude.
13 14 15 |
# File 'lib/geocodio/address.rb', line 13 def latitude @latitude end |
#longitude ⇒ Object (readonly) Also known as: lng
Returns the value of attribute longitude.
13 14 15 |
# File 'lib/geocodio/address.rb', line 13 def longitude @longitude end |
#number ⇒ Object (readonly)
Returns the value of attribute number.
10 11 12 |
# File 'lib/geocodio/address.rb', line 10 def number @number end |
#postdirectional ⇒ Object (readonly)
Returns the value of attribute postdirectional.
10 11 12 |
# File 'lib/geocodio/address.rb', line 10 def postdirectional @postdirectional end |
#predirectional ⇒ Object (readonly)
Returns the value of attribute predirectional.
10 11 12 |
# File 'lib/geocodio/address.rb', line 10 def predirectional @predirectional end |
#secondary_school_district ⇒ Object (readonly)
Returns the value of attribute secondary_school_district.
17 18 19 |
# File 'lib/geocodio/address.rb', line 17 def secondary_school_district @secondary_school_district end |
#senate_districts ⇒ Object (readonly)
Returns the value of attribute senate_districts.
17 18 19 |
# File 'lib/geocodio/address.rb', line 17 def senate_districts @senate_districts end |
#source ⇒ Float (readonly)
How accurate geocod.io deemed this result to be given the original query.
26 27 28 |
# File 'lib/geocodio/address.rb', line 26 def source @source end |
#state ⇒ Object (readonly)
Returns the value of attribute state.
10 11 12 |
# File 'lib/geocodio/address.rb', line 10 def state @state end |
#street ⇒ Object (readonly)
Returns the value of attribute street.
10 11 12 |
# File 'lib/geocodio/address.rb', line 10 def street @street end |
#suffix ⇒ Object (readonly)
Returns the value of attribute suffix.
10 11 12 |
# File 'lib/geocodio/address.rb', line 10 def suffix @suffix end |
#timezone ⇒ Object (readonly)
Returns the value of attribute timezone.
21 22 23 |
# File 'lib/geocodio/address.rb', line 21 def timezone @timezone end |
#unified_school_district ⇒ Object (readonly)
Returns the value of attribute unified_school_district.
17 18 19 |
# File 'lib/geocodio/address.rb', line 17 def unified_school_district @unified_school_district end |
#zip ⇒ Object (readonly)
Returns the value of attribute zip.
10 11 12 |
# File 'lib/geocodio/address.rb', line 10 def zip @zip end |
Instance Method Details
#to_s ⇒ String
Formats the address in the standard way.
42 43 44 |
# File 'lib/geocodio/address.rb', line 42 def to_s @formatted_address end |