opium 1.3.4 → 1.3.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6a18b9e563fc79c5c86b05f3eb423e6b6eed3f52
4
- data.tar.gz: c411e0433a02b598dd1f8dc7348f70ad1a5eda8b
3
+ metadata.gz: ba3e984219298d9044d897b69174d070e97203ea
4
+ data.tar.gz: a75539396c4cf16ce7663a6cb2aa0014cf7a5284
5
5
  SHA512:
6
- metadata.gz: 4d4e338a6aa6d2f58dfa7b549c0ce656ee1d07f08f4b1dbd33f54c1ec48d716dacdac2a78373850301a9480312d149c0889868a933e850b200306d84da9bdbd6
7
- data.tar.gz: 9133125cb88dca90ed7f86e3c092876e50dca84ce4f430a733e4048f4774e3f3f79f073062c65aa65af9b562425583a6103dd2a4f770623a76b33bdda8512ae8
6
+ metadata.gz: 01cb3c6a85d9b7164453c422ce2c760a0f30fe16d5130275acc95499e9684c7d7aaeedb39df18241752609c150fd2a5a8bed52f1e5bdb476d06f0ff96d2f3269
7
+ data.tar.gz: 0592a85febebccaae06eb14d3688d3cb33809d6ba185ff481b76b54c6c9b57f26726f53509e16ac4a763420a60390e9bf5716671a90519873c31849056fb43c4
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 1.3.5
2
+ ### New Features
3
+ - Due to ignorance, missed a method override for Opium::GeoPoint ===. Now implemented at the class level as well as at the instance level.
4
+
1
5
  ## 1.3.4
2
6
  ### New Features
3
7
  - Opium::GeoPoint now provides a custom === operator; this either delegates to == (if given another geo point), to != (if given GeoPoint; NULL_ISLAND is an invalid location!), or nil if anything else.
@@ -39,7 +39,7 @@ module Opium
39
39
  if other.is_a? self.class
40
40
  self == other
41
41
  elsif other <= self.class
42
- self != NULL_ISLAND
42
+ self != NULL_ISLAND
43
43
  else
44
44
  nil
45
45
  end
@@ -48,6 +48,10 @@ module Opium
48
48
  NULL_ISLAND = new( [0, 0] ).freeze
49
49
 
50
50
  class << self
51
+ def ===( other )
52
+ other != NULL_ISLAND && super
53
+ end
54
+
51
55
  def to_ruby(object)
52
56
  object.to_geo_point unless object.nil?
53
57
  end
data/lib/opium/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Opium
2
- VERSION = "1.3.4"
2
+ VERSION = "1.3.5"
3
3
  end
@@ -101,6 +101,34 @@ describe Opium::GeoPoint do
101
101
  end
102
102
  end
103
103
 
104
+ describe '#===' do
105
+ let(:result) { described_class === a }
106
+
107
+ context 'with a real location' do
108
+ let(:a) { described_class.new( [1, 1] ) }
109
+
110
+ it { expect( result ).to eq true }
111
+ end
112
+
113
+ context 'with NULL_ISLAND' do
114
+ let(:a) { described_class::NULL_ISLAND }
115
+
116
+ it { expect( result ).to be_falsy }
117
+ end
118
+
119
+ context 'with nil' do
120
+ let(:a) { nil }
121
+
122
+ it { expect( result ).to be_falsy }
123
+ end
124
+
125
+ context 'with non geo data' do
126
+ let(:a) { 23 }
127
+
128
+ it { expect( result ).to be_falsy }
129
+ end
130
+ end
131
+
104
132
  describe '.===' do
105
133
  let(:result) { a === described_class }
106
134
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opium
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.4
4
+ version: 1.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joshua Bowers