Class: ZipCode

Inherits:
ActiveRecord::Base
  • Object
show all
Extended by:
Earth::Model
Defined in:
lib/earth/locality/zip_code.rb

Constant Summary collapse

TABLE_STRUCTURE =
<<-EOS

CREATE TABLE zip_codes
  (
     name                         CHARACTER VARYING(255) NOT NULL PRIMARY KEY,
     state_postal_abbreviation    CHARACTER VARYING(255),
     description                  CHARACTER VARYING(255),
     latitude                     CHARACTER VARYING(255),
     longitude                    CHARACTER VARYING(255),
     egrid_subregion_abbreviation CHARACTER VARYING(255),
     climate_division_name        CHARACTER VARYING(255),
     population                   INTEGER
  );

EOS

Instance Method Summary collapse

Methods included from Earth::Model

extend_mining, extended, registry

Instance Method Details

#countryObject



47
48
49
# File 'lib/earth/locality/zip_code.rb', line 47

def country
  Country.united_states
end

#latitude_longitudeObject

Used by LodgingProperty custom find to find properties near to a zip code



52
53
54
# File 'lib/earth/locality/zip_code.rb', line 52

def latitude_longitude
  [latitude, longitude]
end