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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5e4f543fd46662f4fb70fa80e468e5db9c93c1a5
4
- data.tar.gz: bada9b732e08dc80a36c0a53c2be25ecec03ffd4
3
+ metadata.gz: 258e404cb751442f18cc7fef1e5f4a5f994b3d66
4
+ data.tar.gz: bd7c59b9a5f06516c707600539d34873c80deb55
5
5
  SHA512:
6
- metadata.gz: 2a3d0b18d82c6a9260a94038cda1bb4c890fb7243b3780efcd7cf1bc38b54f6b8ac730bf945575fc8f227c0213af8f6a80e178142375857e20ec0c5c8810197e
7
- data.tar.gz: 8ef827a60f8bc6dd29b85245e2f3e9e33783e46b4216992d3376645ce6f7a017665d1d01c79571292fbb7dd12e4c1010aea4e2f8cbddf5ec21f335da1c726b04
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 :reasons_to_decline, String, :serialize => :if_present
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 :account, :listing, :additional_features
13
+ attr_accessor :client, :listing
22
14
 
23
15
  def claim(agent)
24
- MLS.post("/tour_requests/#{token}/claim", {:agent_id => agent.id}) do |response, code|
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(agent, reasons=nil)
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(agent)
37
- MLS.post("/tour_requests/#{token}/view", {:agent_id => agent.id}) do |response, code|
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 account=(account)
86
- @object.account = MLS::Account::Parser.build(account)
65
+ def client=(account)
66
+ @object.client = MLS::Account::Parser.build(account)
87
67
  end
68
+
88
69
  end
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "mls"
6
- s.version = '0.3.8'
6
+ s.version = '0.4.0'
7
7
  s.authors = ["James R. Bracy", "Jon Bracy"]
8
8
  s.email = ["james@42floors.com"]
9
9
  s.homepage = "http://mls.42floors.com"
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.3.8
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 00:00:00.000000000 Z
12
+ date: 2013-06-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake