mls 0.2.12 → 0.2.13
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/mls/models/address.rb +3 -3
- data/lib/mls/models/listing.rb +9 -3
- data/mls.gemspec +1 -1
- data/test/factories/listing.rb +2 -2
- data/test/units/models/test_listing.rb +1 -1
- metadata +25 -80
data/lib/mls/models/address.rb
CHANGED
@@ -48,7 +48,7 @@ class MLS::Address < MLS::Resource
|
|
48
48
|
|
49
49
|
property :avatar_digest, String, :serialize => false
|
50
50
|
|
51
|
-
attr_accessor :listings, :
|
51
|
+
attr_accessor :listings, :listing_types, :photos, :videos
|
52
52
|
|
53
53
|
# should include an optional use address or no_image image
|
54
54
|
def avatar(size='100x200', protocol='http')
|
@@ -159,8 +159,8 @@ class MLS::Address::Parser < MLS::Parser
|
|
159
159
|
}
|
160
160
|
end
|
161
161
|
|
162
|
-
def
|
163
|
-
@object.
|
162
|
+
def listing_types=(listing_types)
|
163
|
+
@object.listing_types = listing_types
|
164
164
|
end
|
165
165
|
|
166
166
|
def photos=(photos)
|
data/lib/mls/models/listing.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
class MLS::Listing < MLS::Resource
|
2
2
|
|
3
3
|
STATES = %w(processing listed leased expired)
|
4
|
-
|
4
|
+
TYPES = %w(lease sublease coworking_space)
|
5
5
|
SPACE_TYPES = %w(unit floor building)
|
6
6
|
LEASE_TERMS = ['Full Service', 'NNN', 'Modified Gross']
|
7
7
|
RATE_UNITS = ['ft^2/year', 'ft^2/month', 'month', 'year', 'desk/month']
|
@@ -21,7 +21,7 @@ class MLS::Listing < MLS::Resource
|
|
21
21
|
property :channel, String, :serialize => :if_present
|
22
22
|
|
23
23
|
property :name, String
|
24
|
-
property :
|
24
|
+
property :type, String, :default => 'lease'
|
25
25
|
property :state, String, :default => 'listed'
|
26
26
|
property :space_type, String, :default => 'unit'
|
27
27
|
property :unit, String
|
@@ -76,8 +76,14 @@ class MLS::Listing < MLS::Resource
|
|
76
76
|
end
|
77
77
|
end
|
78
78
|
|
79
|
+
def lease?
|
80
|
+
type == 'lease'
|
81
|
+
end
|
79
82
|
def sublease?
|
80
|
-
|
83
|
+
type == 'sublease'
|
84
|
+
end
|
85
|
+
def coworking?
|
86
|
+
type == 'coworking_space'
|
81
87
|
end
|
82
88
|
|
83
89
|
def leased?
|
data/mls.gemspec
CHANGED
data/test/factories/listing.rb
CHANGED
@@ -17,13 +17,13 @@ FactoryGirl.define do
|
|
17
17
|
total_size { Kernel.rand(3000..900000) }
|
18
18
|
maximum_contiguous_size { Kernel.rand(3000..900000) }
|
19
19
|
minimum_divisable_size { Kernel.rand(3000..900000) }
|
20
|
-
|
20
|
+
type 'lease'
|
21
21
|
#lease_terms { ::MLS::Listing::LEASE_TERMS.sample }
|
22
22
|
space_type 'unit'
|
23
23
|
rate { rand(15..300) }
|
24
24
|
available_on { Time.now + (20 + rand(0..360).to_i).days }
|
25
25
|
sublease_expiration { |l| l.sublease? ? (l.available_on + (30 + Kernel.rand(10..360)).days) : nil }
|
26
|
-
name { |l| l.
|
26
|
+
name { |l| l.type == 'coworking_space' ? Faker::Name.name : nil }
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
@@ -12,7 +12,7 @@ class TestListing < ::Test::Unit::TestCase
|
|
12
12
|
assert listing.respond_to?(:account_id)
|
13
13
|
assert listing.respond_to?(:hidden)
|
14
14
|
assert listing.respond_to?(:name)
|
15
|
-
assert listing.respond_to?(:
|
15
|
+
assert listing.respond_to?(:type)
|
16
16
|
assert listing.respond_to?(:space_type)
|
17
17
|
assert listing.respond_to?(:unit)
|
18
18
|
assert listing.respond_to?(:floor)
|
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.13
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-01-
|
12
|
+
date: 2013-01-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
16
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirement: &70182825887760 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,15 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements:
|
25
|
-
none: false
|
26
|
-
requirements:
|
27
|
-
- - ! '>='
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
version: '0'
|
24
|
+
version_requirements: *70182825887760
|
30
25
|
- !ruby/object:Gem::Dependency
|
31
26
|
name: rdoc
|
32
|
-
requirement: !ruby/object:Gem::Requirement
|
27
|
+
requirement: &70182825887320 !ruby/object:Gem::Requirement
|
33
28
|
none: false
|
34
29
|
requirements:
|
35
30
|
- - ! '>='
|
@@ -37,15 +32,10 @@ dependencies:
|
|
37
32
|
version: '0'
|
38
33
|
type: :development
|
39
34
|
prerelease: false
|
40
|
-
version_requirements:
|
41
|
-
none: false
|
42
|
-
requirements:
|
43
|
-
- - ! '>='
|
44
|
-
- !ruby/object:Gem::Version
|
45
|
-
version: '0'
|
35
|
+
version_requirements: *70182825887320
|
46
36
|
- !ruby/object:Gem::Dependency
|
47
37
|
name: bundler
|
48
|
-
requirement: !ruby/object:Gem::Requirement
|
38
|
+
requirement: &70182825886900 !ruby/object:Gem::Requirement
|
49
39
|
none: false
|
50
40
|
requirements:
|
51
41
|
- - ! '>='
|
@@ -53,15 +43,10 @@ dependencies:
|
|
53
43
|
version: '0'
|
54
44
|
type: :development
|
55
45
|
prerelease: false
|
56
|
-
version_requirements:
|
57
|
-
none: false
|
58
|
-
requirements:
|
59
|
-
- - ! '>='
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
46
|
+
version_requirements: *70182825886900
|
62
47
|
- !ruby/object:Gem::Dependency
|
63
48
|
name: minitest
|
64
|
-
requirement: !ruby/object:Gem::Requirement
|
49
|
+
requirement: &70182825886480 !ruby/object:Gem::Requirement
|
65
50
|
none: false
|
66
51
|
requirements:
|
67
52
|
- - ! '>='
|
@@ -69,15 +54,10 @@ dependencies:
|
|
69
54
|
version: '0'
|
70
55
|
type: :development
|
71
56
|
prerelease: false
|
72
|
-
version_requirements:
|
73
|
-
none: false
|
74
|
-
requirements:
|
75
|
-
- - ! '>='
|
76
|
-
- !ruby/object:Gem::Version
|
77
|
-
version: '0'
|
57
|
+
version_requirements: *70182825886480
|
78
58
|
- !ruby/object:Gem::Dependency
|
79
59
|
name: turn
|
80
|
-
requirement: !ruby/object:Gem::Requirement
|
60
|
+
requirement: &70182825886020 !ruby/object:Gem::Requirement
|
81
61
|
none: false
|
82
62
|
requirements:
|
83
63
|
- - ! '>='
|
@@ -85,15 +65,10 @@ dependencies:
|
|
85
65
|
version: '0'
|
86
66
|
type: :development
|
87
67
|
prerelease: false
|
88
|
-
version_requirements:
|
89
|
-
none: false
|
90
|
-
requirements:
|
91
|
-
- - ! '>='
|
92
|
-
- !ruby/object:Gem::Version
|
93
|
-
version: '0'
|
68
|
+
version_requirements: *70182825886020
|
94
69
|
- !ruby/object:Gem::Dependency
|
95
70
|
name: faker
|
96
|
-
requirement: !ruby/object:Gem::Requirement
|
71
|
+
requirement: &70182825885540 !ruby/object:Gem::Requirement
|
97
72
|
none: false
|
98
73
|
requirements:
|
99
74
|
- - ! '>='
|
@@ -101,15 +76,10 @@ dependencies:
|
|
101
76
|
version: '0'
|
102
77
|
type: :development
|
103
78
|
prerelease: false
|
104
|
-
version_requirements:
|
105
|
-
none: false
|
106
|
-
requirements:
|
107
|
-
- - ! '>='
|
108
|
-
- !ruby/object:Gem::Version
|
109
|
-
version: '0'
|
79
|
+
version_requirements: *70182825885540
|
110
80
|
- !ruby/object:Gem::Dependency
|
111
81
|
name: factory_girl
|
112
|
-
requirement: !ruby/object:Gem::Requirement
|
82
|
+
requirement: &70182825881220 !ruby/object:Gem::Requirement
|
113
83
|
none: false
|
114
84
|
requirements:
|
115
85
|
- - ! '>='
|
@@ -117,15 +87,10 @@ dependencies:
|
|
117
87
|
version: '0'
|
118
88
|
type: :development
|
119
89
|
prerelease: false
|
120
|
-
version_requirements:
|
121
|
-
none: false
|
122
|
-
requirements:
|
123
|
-
- - ! '>='
|
124
|
-
- !ruby/object:Gem::Version
|
125
|
-
version: '0'
|
90
|
+
version_requirements: *70182825881220
|
126
91
|
- !ruby/object:Gem::Dependency
|
127
92
|
name: fakeweb
|
128
|
-
requirement: !ruby/object:Gem::Requirement
|
93
|
+
requirement: &70182825880640 !ruby/object:Gem::Requirement
|
129
94
|
none: false
|
130
95
|
requirements:
|
131
96
|
- - ! '>='
|
@@ -133,15 +98,10 @@ dependencies:
|
|
133
98
|
version: '0'
|
134
99
|
type: :development
|
135
100
|
prerelease: false
|
136
|
-
version_requirements:
|
137
|
-
none: false
|
138
|
-
requirements:
|
139
|
-
- - ! '>='
|
140
|
-
- !ruby/object:Gem::Version
|
141
|
-
version: '0'
|
101
|
+
version_requirements: *70182825880640
|
142
102
|
- !ruby/object:Gem::Dependency
|
143
103
|
name: activesupport
|
144
|
-
requirement: !ruby/object:Gem::Requirement
|
104
|
+
requirement: &70182825880080 !ruby/object:Gem::Requirement
|
145
105
|
none: false
|
146
106
|
requirements:
|
147
107
|
- - ! '>='
|
@@ -149,15 +109,10 @@ dependencies:
|
|
149
109
|
version: '0'
|
150
110
|
type: :runtime
|
151
111
|
prerelease: false
|
152
|
-
version_requirements:
|
153
|
-
none: false
|
154
|
-
requirements:
|
155
|
-
- - ! '>='
|
156
|
-
- !ruby/object:Gem::Version
|
157
|
-
version: '0'
|
112
|
+
version_requirements: *70182825880080
|
158
113
|
- !ruby/object:Gem::Dependency
|
159
114
|
name: yajl-ruby
|
160
|
-
requirement: !ruby/object:Gem::Requirement
|
115
|
+
requirement: &70182825879360 !ruby/object:Gem::Requirement
|
161
116
|
none: false
|
162
117
|
requirements:
|
163
118
|
- - ! '>='
|
@@ -165,15 +120,10 @@ dependencies:
|
|
165
120
|
version: '0'
|
166
121
|
type: :runtime
|
167
122
|
prerelease: false
|
168
|
-
version_requirements:
|
169
|
-
none: false
|
170
|
-
requirements:
|
171
|
-
- - ! '>='
|
172
|
-
- !ruby/object:Gem::Version
|
173
|
-
version: '0'
|
123
|
+
version_requirements: *70182825879360
|
174
124
|
- !ruby/object:Gem::Dependency
|
175
125
|
name: rest-client
|
176
|
-
requirement: !ruby/object:Gem::Requirement
|
126
|
+
requirement: &70182825878900 !ruby/object:Gem::Requirement
|
177
127
|
none: false
|
178
128
|
requirements:
|
179
129
|
- - ! '>='
|
@@ -181,12 +131,7 @@ dependencies:
|
|
181
131
|
version: '0'
|
182
132
|
type: :runtime
|
183
133
|
prerelease: false
|
184
|
-
version_requirements:
|
185
|
-
none: false
|
186
|
-
requirements:
|
187
|
-
- - ! '>='
|
188
|
-
- !ruby/object:Gem::Version
|
189
|
-
version: '0'
|
134
|
+
version_requirements: *70182825878900
|
190
135
|
description: Ruby library for integrating with the 42Floors MLS
|
191
136
|
email:
|
192
137
|
- james@42floors.com
|
@@ -281,7 +226,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
281
226
|
version: '0'
|
282
227
|
requirements: []
|
283
228
|
rubyforge_project: mls
|
284
|
-
rubygems_version: 1.8.
|
229
|
+
rubygems_version: 1.8.11
|
285
230
|
signing_key:
|
286
231
|
specification_version: 3
|
287
232
|
summary: 42Floors MLS Client
|