mls 0.3.8 → 0.4.0
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/tour_request.rb +15 -34
- 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: 258e404cb751442f18cc7fef1e5f4a5f994b3d66
|
4
|
+
data.tar.gz: bd7c59b9a5f06516c707600539d34873c80deb55
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3f4a136e37e8658b03b39b8af88e209af492685907cf78f48fe5f8670565292135271f6f61b8128c2170f3596ad66cbd922ca92a3d49e29784231fb99f120067
|
7
|
+
data.tar.gz: e0d2f38b9935a0ec57c508f6d85a04ee26342c6075fde069fad11c0061e3c4860acd03165dd2909cb3177795ecc7b6a0eaff0faea9997b8e02839c58b58e5a53
|
@@ -1,42 +1,27 @@
|
|
1
1
|
class MLS::TourRequest < MLS::Resource
|
2
|
-
property :message, String
|
3
|
-
|
4
2
|
property :id, Fixnum
|
5
|
-
property :account_id, Fixnum
|
6
|
-
property :listing_id, Fixnum
|
7
|
-
property :contact_id, Fixnum
|
8
|
-
property :message, String
|
9
|
-
property :company, String
|
10
|
-
property :population, String
|
11
|
-
property :growing, Boolean
|
12
|
-
property :updated_by_id, Fixnum
|
13
3
|
property :status, String
|
14
|
-
property :
|
15
|
-
|
4
|
+
property :client_id, Fixnum
|
5
|
+
property :agent_id, Fixnum
|
6
|
+
property :listing_id, Fixnum
|
7
|
+
property :comments, String
|
8
|
+
property :agent_comments, String, :serialize => :if_present
|
16
9
|
property :token, String, :serialize => :false
|
17
|
-
|
18
10
|
property :created_at, DateTime, :serialize => :false
|
19
11
|
property :updated_at, DateTime, :serialize => :false
|
20
12
|
|
21
|
-
attr_accessor :
|
13
|
+
attr_accessor :client, :listing
|
22
14
|
|
23
15
|
def claim(agent)
|
24
|
-
MLS.post("/tour_requests/#{token}/claim", {:agent_id => agent.id})
|
25
|
-
return code == 200
|
26
|
-
end
|
16
|
+
MLS.post("/tour_requests/#{token}/claim", {:agent_id => agent.id})
|
27
17
|
end
|
28
18
|
|
29
|
-
def decline(
|
30
|
-
MLS.post("/tour_requests/#{token}/decline",
|
31
|
-
{:agent_id => agent.id, :reasons_to_decline => reasons}) do |response, code|
|
32
|
-
return code == 200
|
33
|
-
end
|
19
|
+
def decline(comments=nil)
|
20
|
+
MLS.post("/tour_requests/#{token}/decline", {:agent_comments => reasons})
|
34
21
|
end
|
35
22
|
|
36
|
-
def view
|
37
|
-
MLS.post("/tour_requests/#{token}/view"
|
38
|
-
return code == 200
|
39
|
-
end
|
23
|
+
def view
|
24
|
+
MLS.post("/tour_requests/#{token}/view")
|
40
25
|
end
|
41
26
|
|
42
27
|
def viewed?
|
@@ -51,12 +36,6 @@ class MLS::TourRequest < MLS::Resource
|
|
51
36
|
status == "declined"
|
52
37
|
end
|
53
38
|
|
54
|
-
def to_hash
|
55
|
-
hash = super
|
56
|
-
hash[:additional_features_attributes] = additional_features.to_hash if additional_features
|
57
|
-
hash
|
58
|
-
end
|
59
|
-
|
60
39
|
class << self
|
61
40
|
def get_all_for_account
|
62
41
|
response = MLS.get('/account/tour_requests')
|
@@ -74,6 +53,7 @@ class MLS::TourRequest < MLS::Resource
|
|
74
53
|
return MLS::TourRequest::Parser.parse(response.body)
|
75
54
|
end
|
76
55
|
end
|
56
|
+
|
77
57
|
end
|
78
58
|
|
79
59
|
class MLS::TourRequest::Parser < MLS::Parser
|
@@ -82,7 +62,8 @@ class MLS::TourRequest::Parser < MLS::Parser
|
|
82
62
|
@object.listing = MLS::Listing::Parser.build(listing)
|
83
63
|
end
|
84
64
|
|
85
|
-
def
|
86
|
-
@object.
|
65
|
+
def client=(account)
|
66
|
+
@object.client = MLS::Account::Parser.build(account)
|
87
67
|
end
|
68
|
+
|
88
69
|
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.
|
4
|
+
version: 0.4.0
|
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-13 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|