mls 0.2.46 → 0.2.47
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mls/models/region.rb +16 -3
- data/mls.gemspec +1 -1
- 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: fb2a396c4ccae46cec2091d2e5e6dbbcc660639e
|
4
|
+
data.tar.gz: 60de7725b4fa2f4c5a81d8c359ba4b16840d18a5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8d515068162bb01c50dcd0c833798c16577a77f47e658da0e9d2847a2f1c11e74d8a19476cb3cba4f8b8b3f2c66e436ead463d70d32d68fe0b0594da95dd8fb1
|
7
|
+
data.tar.gz: 96dd51339fdae2642fddd5335fd332fd75825c64e837482f82eed6b3d68aae45f42d5f269ce5ecc7870317b77067b2250478bbd4e8f80db1e43a1e85da8f416b
|
data/lib/mls/models/region.rb
CHANGED
@@ -13,17 +13,30 @@ class MLS::Region < MLS::Resource
|
|
13
13
|
property :geometry, Hash, :serialize => false
|
14
14
|
property :envelope, Hash, :serialize => false
|
15
15
|
property :children, Hash, :serialize => false
|
16
|
-
|
16
|
+
|
17
17
|
# Counter caches
|
18
18
|
property :listings_count, Fixnum, :serialize => :false
|
19
19
|
|
20
20
|
class << self
|
21
|
-
|
21
|
+
|
22
22
|
def find(id)
|
23
23
|
response = MLS.get("/regions/#{id}")
|
24
24
|
MLS::Region::Parser.parse(response.body)
|
25
25
|
end
|
26
|
-
|
26
|
+
|
27
|
+
end
|
28
|
+
|
29
|
+
def bounds
|
30
|
+
return nil unless envelope
|
31
|
+
n, e, s, w = nil, nil, nil, nil
|
32
|
+
envelope[:coordinates][0].each do |c|
|
33
|
+
lon, lat = *c
|
34
|
+
n = lat if !n || lat > n
|
35
|
+
e = lon if !e || lon > e
|
36
|
+
s = lat if !s || lat < s
|
37
|
+
w = lon if !w || lon < w
|
38
|
+
end
|
39
|
+
[n, e, s, w]
|
27
40
|
end
|
28
41
|
|
29
42
|
end
|
data/mls.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mls
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.47
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James R. Bracy
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-04-
|
12
|
+
date: 2013-04-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|