state_helper 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bb3aa5dccfb0c7ec090201903be39ead420d297d
4
- data.tar.gz: 5bddd106ae7ca19bcd1b403522c0bf856aaa095d
3
+ metadata.gz: fa027141e9df1ef4bd8cdd9c89632c7de7663dd8
4
+ data.tar.gz: e4c7c677cc05db075ede9d7d9bf94facd403f049
5
5
  SHA512:
6
- metadata.gz: 6025356c6bdc41298bf6348de669c0ccbe39bacac4c1d33e8cd54b93a208a49a3f7870aa20201b8a84a18776eee03dbdc19845b3d4409cc59f4b1fe82cf9bdc9
7
- data.tar.gz: 3ff1e4136648157d15402fa029e0ffce14db7e0b07eaa7bb7c3dcd2e0f44d95456d1dd0120a167a5f8fed18fc582dcdb70bb3d49593a2334847555bee0692924
6
+ metadata.gz: b751082e84ba4741b79f306f39e0008c566d6f8acf591c478560986156c3015658aa52da0589dee4ff0eba63c670008312d6e429e5c54da75647df89b2812545
7
+ data.tar.gz: f17b657f5b11a8fc100951b8c75fc033d02594a18eea4a2dbe375b8455850a8db4faf928639de711ce39b456ef5b12b5caabb4ee564410a531770871600493b6
@@ -1,78 +1,80 @@
1
1
  module StateHelper
2
- class States
3
- attr_reader :states
2
+ class States
3
+ attr_reader :states
4
4
 
5
- def initialize
6
- @states = {
7
- 'Alabama' => 'AL',
8
- 'Alaska' => 'AK',
9
- 'Arizona' => 'AZ',
10
- 'Arkansas' => 'AR',
11
- 'California' => 'CA',
12
- 'Colorado' => 'CO',
13
- 'Connecticut' => 'CT',
14
- 'Delaware' => 'DE',
15
- 'Florida' => 'FL',
16
- 'Georgia' => 'GA',
17
- 'Hawaii' => 'HI',
18
- 'Idaho' => 'ID',
19
- 'Illinois' => 'IL',
20
- 'Indiana' => 'IN',
21
- 'Iowa' => 'IA',
22
- 'Kansas' => 'KS',
23
- 'Kentucky' => 'KY',
24
- 'Louisiana' => 'LA',
25
- 'Maine' => 'ME',
26
- 'Maryland' => 'MD',
27
- 'Massachusetts' => 'MA',
28
- 'Michigan' => 'MI',
29
- 'Minnesota' => 'MN',
30
- 'Mississippi' => 'MS',
31
- 'Missouri' => 'MO',
32
- 'Montana' => 'MT',
33
- 'Nebraska' => 'NE',
34
- 'Nevada' => 'NV',
35
- 'New Hampshire' => 'NH',
36
- 'New Jersey' => 'NJ',
37
- 'New Mexico' => 'NM',
38
- 'New York' => 'NY',
39
- 'North Carolina' => 'NC',
40
- 'North Dakota' => 'ND',
41
- 'Ohio' => 'OH',
42
- 'Oklahoma' => 'OK',
43
- 'Oregon' => 'OR',
44
- 'Pennsylvania' => 'PA',
45
- 'Rhode Island' => 'RI',
46
- 'South Carolina' => 'SC',
47
- 'South Dakota' => 'SD',
48
- 'Tennessee' => 'TN',
49
- 'Texas' => 'TX',
50
- 'Utah' => 'UT',
51
- 'Vermont' => 'VT',
52
- 'Virginia' => 'VA',
53
- 'Washington' => 'WA',
54
- 'West Virginia' => 'WV',
55
- 'Wisconsin' => 'WI',
56
- 'Wyoming' => 'WY',
57
- 'Washington DC' => 'DC'
58
- }
59
- end
5
+ def initialize
6
+ @states = {
7
+ 'Alabama' => 'AL',
8
+ 'Alaska' => 'AK',
9
+ 'Arizona' => 'AZ',
10
+ 'Arkansas' => 'AR',
11
+ 'California' => 'CA',
12
+ 'Colorado' => 'CO',
13
+ 'Connecticut' => 'CT',
14
+ 'Delaware' => 'DE',
15
+ 'Florida' => 'FL',
16
+ 'Georgia' => 'GA',
17
+ 'Guam' => 'GU',
18
+ 'Hawaii' => 'HI',
19
+ 'Idaho' => 'ID',
20
+ 'Illinois' => 'IL',
21
+ 'Indiana' => 'IN',
22
+ 'Iowa' => 'IA',
23
+ 'Kansas' => 'KS',
24
+ 'Kentucky' => 'KY',
25
+ 'Louisiana' => 'LA',
26
+ 'Maine' => 'ME',
27
+ 'Maryland' => 'MD',
28
+ 'Massachusetts' => 'MA',
29
+ 'Michigan' => 'MI',
30
+ 'Minnesota' => 'MN',
31
+ 'Mississippi' => 'MS',
32
+ 'Missouri' => 'MO',
33
+ 'Montana' => 'MT',
34
+ 'Nebraska' => 'NE',
35
+ 'Nevada' => 'NV',
36
+ 'New Hampshire' => 'NH',
37
+ 'New Jersey' => 'NJ',
38
+ 'New Mexico' => 'NM',
39
+ 'New York' => 'NY',
40
+ 'North Carolina' => 'NC',
41
+ 'North Dakota' => 'ND',
42
+ 'Ohio' => 'OH',
43
+ 'Oklahoma' => 'OK',
44
+ 'Oregon' => 'OR',
45
+ 'Pennsylvania' => 'PA',
46
+ 'Rhode Island' => 'RI',
47
+ 'South Carolina' => 'SC',
48
+ 'South Dakota' => 'SD',
49
+ 'Tennessee' => 'TN',
50
+ 'Texas' => 'TX',
51
+ 'Utah' => 'UT',
52
+ 'Vermont' => 'VT',
53
+ 'Virginia' => 'VA',
54
+ 'Virgin Islands' => 'VI',
55
+ 'Washington' => 'WA',
56
+ 'West Virginia' => 'WV',
57
+ 'Wisconsin' => 'WI',
58
+ 'Wyoming' => 'WY',
59
+ 'Washington DC' => 'DC'
60
+ }
61
+ end
60
62
 
61
- def codes
62
- @states.values
63
- end
63
+ def codes
64
+ @states.values
65
+ end
64
66
 
65
- def names
66
- @states.keys
67
- end
67
+ def names
68
+ @states.keys
69
+ end
68
70
 
69
- def get_name_by_code code
70
- @states.select {|key, value| value == code.upcase}.first.first
71
- end
71
+ def get_name_by_code code
72
+ @states.select {|key, value| value == code.upcase}.first.first
73
+ end
72
74
 
73
- def get_code_by_name name
74
- @states[name.titleize]
75
- end
75
+ def get_code_by_name name
76
+ @states[name.titleize]
77
+ end
76
78
 
77
- end
79
+ end
78
80
  end
@@ -1,3 +1,3 @@
1
1
  module StateHelper
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: state_helper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Daily
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-14 00:00:00.000000000 Z
11
+ date: 2016-04-04 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: get state name and code by either.
14
14
  email:
@@ -44,7 +44,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
44
44
  version: '0'
45
45
  requirements: []
46
46
  rubyforge_project:
47
- rubygems_version: 2.4.5
47
+ rubygems_version: 2.5.1
48
48
  signing_key:
49
49
  specification_version: 4
50
50
  summary: A State Helper.