geolookup 0.5.1 → 0.5.2

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: 691d2b670b1c6d09b1845bd327b4be42dd88b65f
4
- data.tar.gz: 87885cde8f1eb5925e8b623f21e89ac357fceb76
3
+ metadata.gz: 6d5438bf0b5a02acfc8e0228ca7b07e2b68f1a5a
4
+ data.tar.gz: 0c515b431a3ef244afee3527830a81817ed6c678
5
5
  SHA512:
6
- metadata.gz: d38fd668d0751eb8a3ed093f6f62d364d001336cb1ff16bae982f4ac503931c9c2358597b9eeb27f0114953afefb068bde5c87c49f284ea614a8a0cfec8f08a1
7
- data.tar.gz: 806a5a53586bceb7667c89e269344b9f79a63f158424109e8e79920c0116bd7e7ab5a2055629d6c3bffbfa6020e922e2e65be83fb0c356934519aea40599c27b
6
+ metadata.gz: ceac98206849d6416b7a36bc662470002824e86704528a9837be386b30276e38da59389f2b36d0bc2d9faf4ddffd92ba99d9e83f8850296bd614fd7c35b16821
7
+ data.tar.gz: 6c5f02d63412f53c7a1921c436c94bb8ded709dcae9fc2a3a806d55f47c2a3553ecd3c1c090e6282dd6b23e8da368ed535a8b8c0b9a99385c81dc0e8642049d7
data/CHANGELOG.rdoc CHANGED
@@ -1,3 +1,6 @@
1
+ === 0.5.2
2
+ - Adding a state.abbreviations and state.names to return an array of us state abbreviations and names
3
+
1
4
  === 0.5.1
2
5
  - Adding a function on state to go from state name to abbreviation #name_to_abbreviation
3
6
 
@@ -67,6 +67,25 @@ module Geolookup
67
67
  STATE_LAT_LONG[state_code.to_s.to_i]
68
68
  end
69
69
 
70
+ ###################################################################
71
+ # self.abbreviations
72
+ #
73
+ # Returns an array of state abbreviations
74
+ #
75
+ def self.abbreviations
76
+ CODE_TO_STATE.values
77
+ end
78
+
79
+
80
+ ###################################################################
81
+ # self.names
82
+ #
83
+ # Returns an array of state names
84
+ #
85
+ def self.names
86
+ STATE_CODE_TO_FULL.values
87
+ end
88
+
70
89
  class << self
71
90
  alias :abbreviation_to_code :name_to_code
72
91
  alias :abbreviation_to_lat_long :name_to_lat_long
@@ -1,3 +1,3 @@
1
1
  module Geolookup
2
- VERSION = "0.5.1"
2
+ VERSION = "0.5.2"
3
3
  end
@@ -21,6 +21,18 @@ describe "Geolookup::USA::State" do
21
21
  end
22
22
  end
23
23
 
24
+ describe "#state_abbreviations" do
25
+ it "should return an array of state abbreviation" do
26
+ expect(Geolookup::USA::State.abbreviations).to include("CA")
27
+ end
28
+ end
29
+
30
+ describe "#names" do
31
+ it "should return an array of state names" do
32
+ expect(Geolookup::USA::State.names).to include("California")
33
+ end
34
+ end
35
+
24
36
  describe "#code_to_abbreviation" do
25
37
  it 'should return a state abbreviation gien a state code' do
26
38
  expect(Geolookup::USA::State.code_to_abbreviation(1)).to eql("AL")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: geolookup
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Austin Fonacier
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-02-06 00:00:00.000000000 Z
12
+ date: 2014-02-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler