mls 0.2.35 → 0.2.36
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +1 -0
- data/lib/mls.rb +5 -1
- data/lib/mls/models/address.rb +2 -2
- data/lib/mls/models/floorplan.rb +2 -2
- data/lib/mls/models/flyer.rb +2 -2
- data/lib/mls/models/listing.rb +2 -2
- data/lib/mls/models/pdf.rb +2 -2
- data/lib/mls/models/photo.rb +2 -2
- data/lib/mls/models/tour_request.rb +0 -1
- data/mls.gemspec +1 -1
- metadata +3 -3
data/README.rdoc
CHANGED
data/lib/mls.rb
CHANGED
@@ -24,7 +24,7 @@ class MLS
|
|
24
24
|
API_VERSION = '0.1.0'
|
25
25
|
|
26
26
|
attr_reader :url, :user_agent
|
27
|
-
attr_writer :asset_host, :listing_amenities, :address_amenities
|
27
|
+
attr_writer :asset_host, :image_host, :listing_amenities, :address_amenities
|
28
28
|
attr_accessor :api_key, :auth_key, :logger
|
29
29
|
|
30
30
|
# Sets the API Token and Host of the MLS Server
|
@@ -58,6 +58,10 @@ class MLS
|
|
58
58
|
def asset_host # TODO: testme
|
59
59
|
@asset_host ||= get('/asset_host').body
|
60
60
|
end
|
61
|
+
|
62
|
+
def image_host # TODO: testme
|
63
|
+
@asset_host ||= get('/image_host').body
|
64
|
+
end
|
61
65
|
|
62
66
|
def listing_amenities
|
63
67
|
@listing_amenities ||= Yajl::Parser.new(:symbolize_keys => true)
|
data/lib/mls/models/address.rb
CHANGED
@@ -51,7 +51,7 @@ class MLS::Address < MLS::Resource
|
|
51
51
|
attr_accessor :listings, :listing_types, :photos, :videos
|
52
52
|
|
53
53
|
# should include an optional use address or no_image image
|
54
|
-
def avatar(size='100x200', protocol='http')
|
54
|
+
def avatar(size='100x200#', protocol='http')
|
55
55
|
params = {
|
56
56
|
:size => size,
|
57
57
|
:format => 'png',
|
@@ -61,7 +61,7 @@ class MLS::Address < MLS::Resource
|
|
61
61
|
}
|
62
62
|
|
63
63
|
if avatar_digest
|
64
|
-
"#{protocol}://#{MLS.
|
64
|
+
"#{protocol}://#{MLS.image_host}/#{avatar_digest}.jpg?s=#{URI.escape(size)}"
|
65
65
|
else
|
66
66
|
"#{protocol}://maps.googleapis.com/maps/api/streetview?" + params.map{|k,v| k.to_s + '=' + URI.escape(v.to_s) }.join('&')
|
67
67
|
end
|
data/lib/mls/models/floorplan.rb
CHANGED
@@ -12,8 +12,8 @@ class MLS::Floorplan < MLS::Resource
|
|
12
12
|
"#{protocol}://#{MLS.asset_host}/floorplans/#{digest}/#{file_name}"
|
13
13
|
end
|
14
14
|
|
15
|
-
def avatar(size='150x100', protocol='http')
|
16
|
-
"#{protocol}://#{MLS.
|
15
|
+
def avatar(size='150x100#', protocol='http')
|
16
|
+
"#{protocol}://#{MLS.image_host}/#{avatar_digest}.jpg?s=#{URI.escape(size)}"
|
17
17
|
end
|
18
18
|
|
19
19
|
def self.create(attrs)
|
data/lib/mls/models/flyer.rb
CHANGED
@@ -12,8 +12,8 @@ class MLS::Flyer < MLS::Resource
|
|
12
12
|
"#{protocol}://#{MLS.asset_host}/flyers/#{digest}/#{file_name}"
|
13
13
|
end
|
14
14
|
|
15
|
-
def avatar(size='150x100', protocol='http')
|
16
|
-
"#{protocol}://#{MLS.
|
15
|
+
def avatar(size='150x100#', protocol='http')
|
16
|
+
"#{protocol}://#{MLS.image_host}/#{avatar_digest}.jpg?s=#{URI.escape(size)}"
|
17
17
|
end
|
18
18
|
|
19
19
|
def self.create(attrs)
|
data/lib/mls/models/listing.rb
CHANGED
@@ -69,9 +69,9 @@ class MLS::Listing < MLS::Resource
|
|
69
69
|
attr_accessor :address, :agents, :account, :photos, :flyer, :floorplan, :videos
|
70
70
|
attr_writer :amenities
|
71
71
|
|
72
|
-
def avatar(size='150x100', protocol='http')
|
72
|
+
def avatar(size='150x100#', protocol='http')
|
73
73
|
if avatar_digest
|
74
|
-
"#{protocol}://#{MLS.
|
74
|
+
"#{protocol}://#{MLS.image_host}/#{avatar_digest}.jpg?s=#{URI.escape(size)}"
|
75
75
|
else
|
76
76
|
address.avatar(size, protocol)
|
77
77
|
end
|
data/lib/mls/models/pdf.rb
CHANGED
@@ -5,8 +5,8 @@ class MLS::PDF < MLS::Resource
|
|
5
5
|
property :file_url, String
|
6
6
|
property :type, String
|
7
7
|
|
8
|
-
def url(style='
|
9
|
-
"#{protocol}://#{MLS.
|
8
|
+
def url(style='700x467#', protocol='http')
|
9
|
+
"#{protocol}://#{MLS.image_host}/#{avatar_digest}.jpg?s=#{URI.escape(size)}"
|
10
10
|
end
|
11
11
|
end
|
12
12
|
|
data/lib/mls/models/photo.rb
CHANGED
@@ -12,8 +12,8 @@ class MLS::Photo < MLS::Resource
|
|
12
12
|
property :url_template, String
|
13
13
|
property :caption, String
|
14
14
|
|
15
|
-
def url(style='
|
16
|
-
"#{protocol}://#{MLS.
|
15
|
+
def url(style='700x467#', protocol='http')
|
16
|
+
"#{protocol}://#{MLS.image_host}/#{digest}.jpg?s=#{URI.escape(style)}"
|
17
17
|
end
|
18
18
|
|
19
19
|
def self.create(attrs)
|
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.36
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2013-02-
|
13
|
+
date: 2013-02-25 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rake
|
@@ -283,7 +283,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
283
283
|
version: '0'
|
284
284
|
requirements: []
|
285
285
|
rubyforge_project: mls
|
286
|
-
rubygems_version: 1.8.
|
286
|
+
rubygems_version: 1.8.23
|
287
287
|
signing_key:
|
288
288
|
specification_version: 3
|
289
289
|
summary: 42Floors MLS Client
|