lib/geolookup/usa/state.rb in geolookup-0.6.0 vs lib/geolookup/usa/state.rb in geolookup-0.6.1
- old
+ new
@@ -5,17 +5,19 @@
STATE_CODE_TO_FULL_FILE = 'STATE_CODE_TO_FULL.yml'
STATE_CODE_TO_ABBREVIATION_FILE = 'STATE_CODE_TO_STATE.yml'
STATE_NAME_TO_CODE_FILE = 'STATE_NAME_TO_CODE.yml'
STATE_ABBREVIATION_TO_NAME_FILE = 'STATE_FULL_STATE_NAMES.yml'
STATE_LAT_LONG_FILE = 'STATE_LAT_LONG.yml'
+ IGNORED_STATES_FILE = 'IGNORED_STATES.yml'
DOMESTIC_STATE_CUTOFF = 56
@state_code_to_full
@state_code_to_abbreviation
@state_name_to_code
@state_abbreviation_to_name
@state_lat_long
+ @ignored_states
@domestic_state_code_to_name
@domestic_state_code_to_abbreviation
###################################################################
# self.code_to_name
#
@@ -160,9 +162,29 @@
# Returns an array of state names
#
def self.codes
@state_code_to_full ||= Geolookup.load_hash_from_file(STATE_CODE_TO_FULL_FILE)
@state_code_to_full.keys
+ end
+
+ ###################################################################
+ # self.ignored_state_codes
+ #
+ # Returns an array of ignored state codes
+ #
+ def self.ignored_state_codes
+ @ignored_states ||= Geolookup.load_hash_from_file(IGNORED_STATES_FILE)
+ @ignored_states.keys
+ end
+
+ ###################################################################
+ # self.ignored_state_names
+ #
+ # Returns an array of ignored state names
+ #
+ def self.ignored_state_names
+ @ignored_states ||= Geolookup.load_hash_from_file(IGNORED_STATES_FILE)
+ @ignored_states.values
end
class << self
alias :abbreviation_to_code :name_to_code
alias :abbreviation_to_lat_long :name_to_lat_long