maxminddb 0.1.3 → 0.1.4

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: 386ad7ac9e84aaf85698ce963e747afc0d45155f
4
- data.tar.gz: becf26c375061d81703423c7019aa89591535fb8
3
+ metadata.gz: 90230fd8cd541962af966e81554cb3cda637cb81
4
+ data.tar.gz: 6c4ce02d833d223f205b360d4d3456bbab02759b
5
5
  SHA512:
6
- metadata.gz: fc73fc187a98edcbbe6d7536bb3546372543a40e19728141cf200bccc15f752f8cdb596bdd89d707259dd894ec5d005faea5ba562e128435bd8bf34eb70c8036
7
- data.tar.gz: 952270232f86b80cff33a226a27cfd100795d21f1f99bd060024b85d915b1b1ff5d7ceba9a83a3da9f233c949fb67bc6a130c9a5d097868cfa7660610fe0d378
6
+ metadata.gz: 584fea3d8f68cd1a93bb63eb53d4167bfad0564b2c5df88513d44887aa603c89eb406dfdc5440a60ddfe9046c6b4c069fa1cdb88b6b5144b9f2e33686838e90f
7
+ data.tar.gz: 594c12759914f798db59c7fe2d30c1933bcdc9986b361c0b563487c517000a493ad80d735d801bcaf4b62f58d3a7d5171e7469f73834b353e1a43dafe7e05c2f
@@ -40,6 +40,10 @@ module MaxMindDB
40
40
  @_registered_country ||= NamedLocation.new(raw['registered_country'])
41
41
  end
42
42
 
43
+ def represented_country
44
+ @_represented_country ||= NamedLocation.new(raw['represented_country'])
45
+ end
46
+
43
47
  def subdivisions
44
48
  @_subdivisions ||= Array(raw['subdivisions']).map { |hash| NamedLocation.new(hash) }
45
49
  end
@@ -1,3 +1,3 @@
1
1
  module MaxMindDB
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
@@ -32,6 +32,11 @@ describe MaxMindDB::Result do
32
32
  "iso_code"=>"US",
33
33
  "names"=>{"de"=>"USA", "en"=>"United States", "es"=>"Estados Unidos", "fr"=>"États-Unis", "ja"=>"アメリカ合衆国", "pt-BR"=>"Estados Unidos", "ru"=>"США", "zh-CN"=>"美国"}
34
34
  },
35
+ "represented_country"=>{
36
+ "geoname_id"=>6252001,
37
+ "iso_code"=>"US",
38
+ "names"=>{"de"=>"USA", "en"=>"United States", "es"=>"Estados Unidos", "fr"=>"États-Unis", "ja"=>"アメリカ合衆国", "pt-BR"=>"Estados Unidos", "ru"=>"США", "zh-CN"=>"美国"}
39
+ },
35
40
  "subdivisions"=>[
36
41
  {
37
42
  "geoname_id"=>5332921,
@@ -187,6 +192,20 @@ describe MaxMindDB::Result do
187
192
  end
188
193
  end
189
194
 
195
+ describe '#represented_country' do
196
+ context 'with a result' do
197
+ it 'should be a kind of MaxMindDB::Result::NamedLocation' do
198
+ expect(result.represented_country).to be_kind_of(MaxMindDB::Result::NamedLocation)
199
+ end
200
+
201
+ it 'should initialize the location with the represented_country attributes' do
202
+ expect(MaxMindDB::Result::NamedLocation).to receive(:new).with(raw_result['represented_country'])
203
+
204
+ result.represented_country
205
+ end
206
+ end
207
+ end
208
+
190
209
  describe '#subdivisions' do
191
210
  context 'with a result' do
192
211
  it 'should be a kind of Array' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: maxminddb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - yhirose
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-16 00:00:00.000000000 Z
11
+ date: 2014-11-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -113,7 +113,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
113
113
  version: '0'
114
114
  requirements: []
115
115
  rubyforge_project:
116
- rubygems_version: 2.0.14
116
+ rubygems_version: 2.4.2
117
117
  signing_key:
118
118
  specification_version: 4
119
119
  summary: MaxMind DB binary file reader.