mls 0.5.0 → 0.5.1
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 +4 -4
- data/lib/mls/models/listing.rb +3 -3
- data/lib/mls/models/tour.rb +5 -5
- data/mls.gemspec +1 -1
- data/test/factories/tour.rb +1 -1
- data/test/units/models/test_tour.rb +6 -6
- 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: e0259bdcabcd9435ebe44c1003bfc636500429d9
|
4
|
+
data.tar.gz: 7b100fc2e8b099f2dc104435874d7c223a152050
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 012dbb4b8421a324a42452356dd1f16017235f0b2aeb2e81f1856a2b95e8b96c2e46b8b5be7792ce8b83acf7f363ca01d3d03c93f0012764833ac80d85bf3aad
|
7
|
+
data.tar.gz: 485cc3ccc57724a2000c041dd4b026bc6ef6d5b8f567e80340b02189e53d9670b87d58b045b71f4a13d614c0f0b13c16e6f780af483c42b80884e928faaf0880
|
data/lib/mls/models/listing.rb
CHANGED
@@ -147,11 +147,11 @@ class MLS::Listing < MLS::Resource
|
|
147
147
|
# #!ruby
|
148
148
|
# listing = MLS::Listing.find(@id)
|
149
149
|
# info => {:company => 'name', :population => 10, :funding => 'string', :move_id => '2012-09-12'}
|
150
|
-
# listing.request_tour('name', 'email@address.com', info) # => #<MLS::
|
150
|
+
# listing.request_tour('name', 'email@address.com', info) # => #<MLS::Tour>
|
151
151
|
#
|
152
|
-
# listing.request_tour('', 'emai', info) # => #<MLS::
|
152
|
+
# listing.request_tour('', 'emai', info) # => #<MLS::Tour> will have errors on account
|
153
153
|
def request_tour(account, tour={})
|
154
|
-
MLS::
|
154
|
+
MLS::Tour.create(id, account, tour)
|
155
155
|
end
|
156
156
|
|
157
157
|
|
data/lib/mls/models/tour.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
class MLS::
|
1
|
+
class MLS::Tour < MLS::Resource
|
2
2
|
property :id, Fixnum
|
3
3
|
property :status, String
|
4
4
|
property :client_id, Fixnum
|
@@ -39,24 +39,24 @@ class MLS::TourRequest < MLS::Resource
|
|
39
39
|
class << self
|
40
40
|
def get_all_for_account
|
41
41
|
response = MLS.get('/account/tours')
|
42
|
-
MLS::
|
42
|
+
MLS::Tour::Parser.parse_collection(response.body)
|
43
43
|
end
|
44
44
|
|
45
45
|
def find_by_token(token)
|
46
46
|
response = MLS.get("/tours/#{token}")
|
47
|
-
MLS::
|
47
|
+
MLS::Tour::Parser.parse(response.body)
|
48
48
|
end
|
49
49
|
|
50
50
|
def create(listing_id, account, tour={})
|
51
51
|
params = {:account => account, :tour => tour}
|
52
52
|
response = MLS.post("/listings/#{listing_id}/tours", params)
|
53
|
-
return MLS::
|
53
|
+
return MLS::Tour::Parser.parse(response.body)
|
54
54
|
end
|
55
55
|
end
|
56
56
|
|
57
57
|
end
|
58
58
|
|
59
|
-
class MLS::
|
59
|
+
class MLS::Tour::Parser < MLS::Parser
|
60
60
|
|
61
61
|
def listing=(listing)
|
62
62
|
@object.listing = MLS::Listing::Parser.build(listing)
|
data/mls.gemspec
CHANGED
data/test/factories/tour.rb
CHANGED
@@ -1,26 +1,26 @@
|
|
1
1
|
require 'test_helper'
|
2
2
|
|
3
|
-
class
|
3
|
+
class TestTour < ::Test::Unit::TestCase
|
4
4
|
|
5
5
|
# def test_properties
|
6
|
-
# tr = MLS::
|
6
|
+
# tr = MLS::Tour.new
|
7
7
|
#
|
8
8
|
# assert tr.respond_to?(:message)
|
9
9
|
# end
|
10
10
|
#
|
11
11
|
# def test_attr_accessors
|
12
|
-
# tr = MLS::
|
12
|
+
# tr = MLS::Tour.new
|
13
13
|
#
|
14
14
|
# assert tr.respond_to?(:listing)
|
15
15
|
# end
|
16
16
|
#
|
17
17
|
# def test_class_methods
|
18
|
-
# assert MLS::
|
19
|
-
# assert MLS::
|
18
|
+
# assert MLS::Tour.respond_to?(:get_all_for_account)
|
19
|
+
# assert MLS::Tour.respond_to?(:create)
|
20
20
|
# end
|
21
21
|
#
|
22
22
|
# def test_parser
|
23
|
-
# assert defined?(MLS::
|
23
|
+
# assert defined?(MLS::Tour::Parser)
|
24
24
|
# end
|
25
25
|
|
26
26
|
test 'it' do
|
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.5.
|
4
|
+
version: 0.5.1
|
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-06-
|
12
|
+
date: 2013-06-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|