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 +4 -4
- data/CHANGELOG.rdoc +3 -0
- data/lib/geolookup/usa/state.rb +19 -0
- data/lib/geolookup/version.rb +1 -1
- data/spec/lib/state_spec.rb +12 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6d5438bf0b5a02acfc8e0228ca7b07e2b68f1a5a
|
4
|
+
data.tar.gz: 0c515b431a3ef244afee3527830a81817ed6c678
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ceac98206849d6416b7a36bc662470002824e86704528a9837be386b30276e38da59389f2b36d0bc2d9faf4ddffd92ba99d9e83f8850296bd614fd7c35b16821
|
7
|
+
data.tar.gz: 6c5f02d63412f53c7a1921c436c94bb8ded709dcae9fc2a3a806d55f47c2a3553ecd3c1c090e6282dd6b23e8da368ed535a8b8c0b9a99385c81dc0e8642049d7
|
data/CHANGELOG.rdoc
CHANGED
data/lib/geolookup/usa/state.rb
CHANGED
@@ -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
|
data/lib/geolookup/version.rb
CHANGED
data/spec/lib/state_spec.rb
CHANGED
@@ -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.
|
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-
|
12
|
+
date: 2014-02-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|