simplyrets 0.1 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +46 -13
- data/README.org +6 -6
- data/example.rb +9 -9
- data/lib/simplyrets.rb +33 -56
- data/lib/simplyrets/#listing.rb# +199 -0
- data/lib/simplyrets/api/default_api.rb +154 -0
- data/lib/simplyrets/listing.rb~ +199 -0
- data/lib/simplyrets/models/agent.rb +61 -0
- data/lib/simplyrets/models/base_object.rb +87 -0
- data/lib/simplyrets/models/broker.rb +37 -0
- data/lib/simplyrets/models/contact_information.rb +53 -0
- data/lib/simplyrets/models/error.rb +45 -0
- data/lib/simplyrets/models/geographic_data.rb +69 -0
- data/lib/simplyrets/models/listing.rb +199 -0
- data/lib/simplyrets/models/listing.rb~ +199 -0
- data/lib/simplyrets/models/mls_information.rb +69 -0
- data/lib/simplyrets/models/office.rb +61 -0
- data/lib/simplyrets/models/open_house.rb +37 -0
- data/lib/simplyrets/models/parking.rb +53 -0
- data/lib/simplyrets/models/property.rb +277 -0
- data/lib/simplyrets/models/sales.rb +69 -0
- data/lib/simplyrets/models/school.rb +61 -0
- data/lib/simplyrets/models/street_address.rb +85 -0
- data/lib/simplyrets/models/tax.rb +53 -0
- data/lib/simplyrets/simplyrets.rb +76 -0
- data/lib/simplyrets/simplyrets/api_error.rb +26 -0
- data/lib/simplyrets/simplyrets/configuration.rb +101 -0
- data/lib/simplyrets/simplyrets/request.rb +213 -0
- data/lib/simplyrets/simplyrets/response.rb +156 -0
- data/lib/simplyrets/simplyrets/version.rb +5 -0
- data/simplyrets.gemspec +16 -9
- metadata +153 -36
- data/#example.rb# +0 -29
- data/lib/monkey.rb +0 -90
- data/lib/properties_api.rb +0 -75
- data/lib/simplyrets.rb~ +0 -85
- data/lib/simplyrets/configuration.rb +0 -25
- data/lib/simplyrets/request.rb +0 -205
- data/lib/simplyrets/response.rb +0 -70
- data/lib/simplyrets/version.rb +0 -4
- data/models/agent.rb +0 -39
- data/models/contactinformation.rb +0 -36
- data/models/geographicdata.rb +0 -43
- data/models/listing.rb +0 -95
- data/models/mlsinformation.rb +0 -35
- data/models/office.rb +0 -39
- data/models/property.rb +0 -84
- data/models/school.rb +0 -27
- data/models/streetaddress.rb +0 -47
- data/models/tax.rb +0 -28
- data/pkg/simplyrets-0.1.gem +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9d08f02b46485ff5f193916bea050594e77129ed
|
4
|
+
data.tar.gz: be7c8aecec0bcbfcb0784642ae8881fc957ee84f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 96f645e6f3ab093b225cb8356736516ab495fba4a03707d1f3f8a6ef40c8ffa66f2067aa70ccc7e6a33e5ab4ef72cc90ac05d866ba508be41d19fbcd07912a1a
|
7
|
+
data.tar.gz: 0d2ef1c6086b8a07d6b2dd6ad26880ade28e6c38d184ea23476619a80bc310be596ff15afe503d6454b4d46049c7631138fe0296e0454f8876139bf08035eec6
|
data/Gemfile.lock
CHANGED
@@ -1,27 +1,60 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
simplyrets (0.
|
5
|
-
|
6
|
-
|
7
|
-
typhoeus (>= 0.2.1)
|
4
|
+
simplyrets (1.0.0)
|
5
|
+
json (~> 1.4, >= 1.4.6)
|
6
|
+
typhoeus (~> 0.2, >= 0.2.1)
|
8
7
|
|
9
8
|
GEM
|
10
9
|
remote: http://rubygems.org/
|
11
10
|
specs:
|
12
|
-
|
13
|
-
|
11
|
+
ZenTest (4.11.0)
|
12
|
+
addressable (2.3.8)
|
13
|
+
autotest (4.4.6)
|
14
|
+
ZenTest (>= 4.4.1)
|
15
|
+
autotest-fsevent (0.2.10)
|
16
|
+
sys-uname
|
17
|
+
autotest-growl (0.2.16)
|
18
|
+
autotest-rails-pure (4.1.2)
|
19
|
+
crack (0.4.2)
|
20
|
+
safe_yaml (~> 1.0.0)
|
21
|
+
diff-lcs (1.2.5)
|
22
|
+
ethon (0.7.4)
|
14
23
|
ffi (>= 1.3.0)
|
15
|
-
ffi (1.9.
|
16
|
-
json (1.8.
|
17
|
-
|
18
|
-
|
19
|
-
|
24
|
+
ffi (1.9.10)
|
25
|
+
json (1.8.3)
|
26
|
+
rspec (3.3.0)
|
27
|
+
rspec-core (~> 3.3.0)
|
28
|
+
rspec-expectations (~> 3.3.0)
|
29
|
+
rspec-mocks (~> 3.3.0)
|
30
|
+
rspec-core (3.3.2)
|
31
|
+
rspec-support (~> 3.3.0)
|
32
|
+
rspec-expectations (3.3.1)
|
33
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
34
|
+
rspec-support (~> 3.3.0)
|
35
|
+
rspec-mocks (3.3.2)
|
36
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
37
|
+
rspec-support (~> 3.3.0)
|
38
|
+
rspec-support (3.3.0)
|
39
|
+
safe_yaml (1.0.4)
|
40
|
+
sys-uname (1.0.2)
|
41
|
+
ffi (>= 1.0.0)
|
42
|
+
typhoeus (0.7.3)
|
43
|
+
ethon (>= 0.7.4)
|
44
|
+
vcr (2.9.3)
|
45
|
+
webmock (1.21.0)
|
46
|
+
addressable (>= 2.3.6)
|
47
|
+
crack (>= 0.3.2)
|
20
48
|
|
21
49
|
PLATFORMS
|
22
50
|
ruby
|
23
51
|
|
24
52
|
DEPENDENCIES
|
25
|
-
|
26
|
-
|
53
|
+
autotest (~> 4.4, >= 4.4.6)
|
54
|
+
autotest-fsevent (~> 0.2, >= 0.2.10)
|
55
|
+
autotest-growl (~> 0.2, >= 0.2.16)
|
56
|
+
autotest-rails-pure (~> 4.1, >= 4.1.2)
|
57
|
+
rspec (~> 3.2, >= 3.2.0)
|
27
58
|
simplyrets!
|
59
|
+
vcr (~> 2.9, >= 2.9.3)
|
60
|
+
webmock (~> 1.6, >= 1.6.2)
|
data/README.org
CHANGED
@@ -31,7 +31,7 @@ applications and websites with Real Estate data.
|
|
31
31
|
require "properties_api"
|
32
32
|
require "listing"
|
33
33
|
|
34
|
-
SimplyRets.configure do |config|
|
34
|
+
SimplyRetsClient::SimplyRets.configure do |config|
|
35
35
|
config.username = 'simplyrets'
|
36
36
|
config.password = 'simplyrets'
|
37
37
|
end
|
@@ -52,7 +52,7 @@ applications and websites with Real Estate data.
|
|
52
52
|
#+BEGIN_SRC ruby
|
53
53
|
require 'simplyrets'
|
54
54
|
|
55
|
-
SimplyRets.configure do |config|
|
55
|
+
SimplyRetsClient::SimplyRets.configure do |config|
|
56
56
|
config.username = 'simplyrets'
|
57
57
|
config.password = 'simplyrets'
|
58
58
|
end
|
@@ -68,13 +68,13 @@ applications and websites with Real Estate data.
|
|
68
68
|
#+BEGIN_SRC ruby
|
69
69
|
require 'properties_api'
|
70
70
|
|
71
|
-
ps = Properties_api.properties()
|
71
|
+
ps = SimplyRetsClient::Properties_api.properties()
|
72
72
|
p ps
|
73
73
|
#+END_SRC
|
74
74
|
|
75
75
|
Request a single listing by id:
|
76
76
|
#+BEGIN_SRC ruby
|
77
|
-
l = Properties_api.property(mls_id=19548526)
|
77
|
+
l = SimplyRetsClient::Properties_api.property(mls_id=19548526)
|
78
78
|
p l.mls
|
79
79
|
#+END_SRC
|
80
80
|
|
@@ -83,7 +83,7 @@ applications and websites with Real Estate data.
|
|
83
83
|
refined results:
|
84
84
|
#+BEGIN_SRC ruby
|
85
85
|
# listings with minprice of $700,000 and minbeds of 4
|
86
|
-
ps = Properties_api.properties({:minprice => 700000, :minbeds => 4})
|
86
|
+
ps = SimplyRetsClient::Properties_api.properties({:minprice => 700000, :minbeds => 4})
|
87
87
|
p ps
|
88
88
|
#+END_SRC
|
89
89
|
|
@@ -91,7 +91,7 @@ applications and websites with Real Estate data.
|
|
91
91
|
#+BEGIN_SRC ruby
|
92
92
|
# listings within geographics points
|
93
93
|
points = ["29.723837146389066,-95.69778442382812" ,"29.938275329718987,-95.778442382812" ,"29.938275329718987,-95.32974243164061","29.723837146389066,-95.32974243164061"]
|
94
|
-
ps = Properties_api.properties({:points => points})
|
94
|
+
ps = SimplyRetsClient::Properties_api.properties({:points => points})
|
95
95
|
p ps
|
96
96
|
#+END_SRC
|
97
97
|
|
data/example.rb
CHANGED
@@ -4,23 +4,23 @@
|
|
4
4
|
%w(rubygems simplyrets).each {|models| require models}
|
5
5
|
|
6
6
|
require "simplyrets"
|
7
|
-
require "properties_api"
|
8
|
-
require "listing"
|
9
7
|
|
10
|
-
p "
|
8
|
+
p "SimplyRets Ruby SDK"
|
11
9
|
|
12
|
-
SimplyRets.configure do |config|
|
10
|
+
SimplyRetsClient::SimplyRets.configure do |config|
|
13
11
|
config.username = 'simplyrets'
|
14
12
|
config.password = 'simplyrets'
|
15
13
|
end
|
16
14
|
|
17
15
|
# Properties
|
18
|
-
listings = Properties_api.properties({:minbeds => 2
|
16
|
+
listings = SimplyRetsClient::Properties_api.properties({:minbeds => 2})
|
19
17
|
listings.each do |l|
|
20
|
-
p l.property
|
21
|
-
p l.
|
18
|
+
p l.property
|
19
|
+
p l.property.bedrooms
|
20
|
+
p l.office.brokerid
|
22
21
|
end
|
23
22
|
|
24
23
|
# Single Listing
|
25
|
-
prop = Properties_api.property(
|
26
|
-
p
|
24
|
+
prop = SimplyRetsClient::Properties_api.property(63423516)
|
25
|
+
p prop
|
26
|
+
p prop.geo.lat
|
data/lib/simplyrets.rb
CHANGED
@@ -1,57 +1,34 @@
|
|
1
|
-
|
2
|
-
require '
|
3
|
-
require 'simplyrets/configuration'
|
4
|
-
require 'simplyrets/
|
5
|
-
require 'simplyrets/
|
6
|
-
require 'simplyrets/
|
7
|
-
require '
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
# Configure logger. Default to use Rails
|
35
|
-
self.logger ||= configuration.logger || (defined?(Rails) ? Rails.logger : Logger.new(STDOUT))
|
36
|
-
|
37
|
-
# remove :// from scheme
|
38
|
-
configuration.scheme.sub!(/:\/\//, '')
|
39
|
-
|
40
|
-
# remove http(s):// and anything after a slash
|
41
|
-
configuration.host.sub!(/https?:\/\//, '')
|
42
|
-
configuration.host = configuration.host.split('/').first
|
43
|
-
|
44
|
-
# Add leading and trailing slashes to base_path
|
45
|
-
configuration.base_path = "/#{configuration.base_path}".gsub(/\/+/, '/')
|
46
|
-
configuration.base_path = "" if configuration.base_path == "/"
|
47
|
-
end
|
48
|
-
|
49
|
-
end
|
50
|
-
|
51
|
-
end
|
52
|
-
|
53
|
-
class ServerError < StandardError
|
54
|
-
end
|
55
|
-
|
56
|
-
class ClientError < StandardError
|
1
|
+
# SimplyRets common files
|
2
|
+
require 'simplyrets/simplyrets'
|
3
|
+
require 'simplyrets/simplyrets/configuration'
|
4
|
+
require 'simplyrets/simplyrets/api_error'
|
5
|
+
require 'simplyrets/simplyrets/request'
|
6
|
+
require 'simplyrets/simplyrets/response'
|
7
|
+
require 'simplyrets/simplyrets/version'
|
8
|
+
|
9
|
+
# Models
|
10
|
+
require 'simplyrets/models/base_object'
|
11
|
+
require 'simplyrets/models/street_address'
|
12
|
+
require 'simplyrets/models/property'
|
13
|
+
require 'simplyrets/models/listing'
|
14
|
+
require 'simplyrets/models/open_house'
|
15
|
+
require 'simplyrets/models/office'
|
16
|
+
require 'simplyrets/models/agent'
|
17
|
+
require 'simplyrets/models/sales'
|
18
|
+
require 'simplyrets/models/school'
|
19
|
+
require 'simplyrets/models/parking'
|
20
|
+
require 'simplyrets/models/contact_information'
|
21
|
+
require 'simplyrets/models/tax'
|
22
|
+
require 'simplyrets/models/geographic_data'
|
23
|
+
require 'simplyrets/models/broker'
|
24
|
+
require 'simplyrets/models/mls_information'
|
25
|
+
require 'simplyrets/models/error'
|
26
|
+
|
27
|
+
# APIs
|
28
|
+
require 'simplyrets/api/default_api'
|
29
|
+
|
30
|
+
module SimplyRetsClient
|
31
|
+
# Initialize the default configuration
|
32
|
+
SimplyRets.configuration = SimplyRets::Configuration.new
|
33
|
+
SimplyRets.configure { |config| }
|
57
34
|
end
|
@@ -0,0 +1,199 @@
|
|
1
|
+
module SwaggerClient
|
2
|
+
#
|
3
|
+
class Listing < BaseObject
|
4
|
+
attr_accessor :property, :mls_id, :showing_instructions, :office, :disclaimer, :address, :list_date, :agent, :modified, :school, :sales, :photos, :list_price, :listing_id, :mls, :geo, :tax, :remarks, :private_remarks, :lease_term, :lease_type
|
5
|
+
# attribute mapping from ruby-style variable name to JSON key
|
6
|
+
def self.attribute_map
|
7
|
+
{
|
8
|
+
|
9
|
+
# Specific property data associated with listing.
|
10
|
+
:'property' => :'property',
|
11
|
+
|
12
|
+
# A unique identifier for this listing specific to the SimplyRETS API.\n
|
13
|
+
:'mls_id' => :'mlsId',
|
14
|
+
|
15
|
+
# Public instructions for showing the property.
|
16
|
+
:'showing_instructions' => :'showingInstructions',
|
17
|
+
|
18
|
+
# Listing office or brokerage.
|
19
|
+
:'office' => :'office',
|
20
|
+
|
21
|
+
# Data accuracy disclaimer. The value in the disclaimer may\nchange depending on your MLS vendors rules.\n
|
22
|
+
:'disclaimer' => :'disclaimer',
|
23
|
+
|
24
|
+
# Comprehensive property address information
|
25
|
+
:'address' => :'address',
|
26
|
+
|
27
|
+
# Date and time the listing became Active
|
28
|
+
:'list_date' => :'listDate',
|
29
|
+
|
30
|
+
# Comprehensive listing agent information
|
31
|
+
:'agent' => :'agent',
|
32
|
+
|
33
|
+
# Date and time of the last modification
|
34
|
+
:'modified' => :'modified',
|
35
|
+
|
36
|
+
# Comprehensive school zone data
|
37
|
+
:'school' => :'school',
|
38
|
+
|
39
|
+
# Sales data
|
40
|
+
:'sales' => :'sales',
|
41
|
+
|
42
|
+
# Photos of the property. Images are served over https and are\nsuitable for production use on secure websites\n
|
43
|
+
:'photos' => :'photos',
|
44
|
+
|
45
|
+
# Price of the listing
|
46
|
+
:'list_price' => :'listPrice',
|
47
|
+
|
48
|
+
# Data Dictionary v1.3 ListingId. The well known identifier\nfor the listing. The value may be identical to\nmlsId. However, listingId is intended to be the value used\nby a human to retrieve the information about a specific\nlisting.\n
|
49
|
+
:'listing_id' => :'listingId',
|
50
|
+
|
51
|
+
# MLS vendor information and data
|
52
|
+
:'mls' => :'mls',
|
53
|
+
|
54
|
+
# Geographic data for the listing
|
55
|
+
:'geo' => :'geo',
|
56
|
+
|
57
|
+
# Associate tax data
|
58
|
+
:'tax' => :'tax',
|
59
|
+
|
60
|
+
# Description or remarks
|
61
|
+
:'remarks' => :'remarks',
|
62
|
+
|
63
|
+
# Agent only remarks
|
64
|
+
:'private_remarks' => :'privateRemarks',
|
65
|
+
|
66
|
+
#
|
67
|
+
:'lease_term' => :'leaseTerm',
|
68
|
+
|
69
|
+
#
|
70
|
+
:'lease_type' => :'leaseType'
|
71
|
+
|
72
|
+
}
|
73
|
+
end
|
74
|
+
|
75
|
+
# attribute type
|
76
|
+
def self.swagger_types
|
77
|
+
{
|
78
|
+
:'property' => :'Property',
|
79
|
+
:'mls_id' => :'Integer',
|
80
|
+
:'showing_instructions' => :'String',
|
81
|
+
:'office' => :'Office',
|
82
|
+
:'disclaimer' => :'String',
|
83
|
+
:'address' => :'StreetAddress',
|
84
|
+
:'list_date' => :'DateTime',
|
85
|
+
:'agent' => :'Agent',
|
86
|
+
:'modified' => :'DateTime',
|
87
|
+
:'school' => :'School',
|
88
|
+
:'sales' => :'Sales',
|
89
|
+
:'photos' => :'Array<String>',
|
90
|
+
:'list_price' => :'Float',
|
91
|
+
:'listing_id' => :'String',
|
92
|
+
:'mls' => :'MlsInformation',
|
93
|
+
:'geo' => :'GeographicData',
|
94
|
+
:'tax' => :'Tax',
|
95
|
+
:'remarks' => :'String',
|
96
|
+
:'private_remarks' => :'String',
|
97
|
+
:'lease_term' => :'String',
|
98
|
+
:'lease_type' => :'String'
|
99
|
+
|
100
|
+
}
|
101
|
+
end
|
102
|
+
|
103
|
+
def initialize(attributes = {})
|
104
|
+
return if !attributes.is_a?(Hash) || attributes.empty?
|
105
|
+
|
106
|
+
# convert string to symbol for hash key
|
107
|
+
attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
|
108
|
+
|
109
|
+
|
110
|
+
if attributes[:'property']
|
111
|
+
self.property = attributes[:'property']
|
112
|
+
end
|
113
|
+
|
114
|
+
if attributes[:'mlsId']
|
115
|
+
self.mls_id = attributes[:'mlsId']
|
116
|
+
end
|
117
|
+
|
118
|
+
if attributes[:'showingInstructions']
|
119
|
+
self.showing_instructions = attributes[:'showingInstructions']
|
120
|
+
end
|
121
|
+
|
122
|
+
if attributes[:'office']
|
123
|
+
self.office = attributes[:'office']
|
124
|
+
end
|
125
|
+
|
126
|
+
if attributes[:'disclaimer']
|
127
|
+
self.disclaimer = attributes[:'disclaimer']
|
128
|
+
end
|
129
|
+
|
130
|
+
if attributes[:'address']
|
131
|
+
self.address = attributes[:'address']
|
132
|
+
end
|
133
|
+
|
134
|
+
if attributes[:'listDate']
|
135
|
+
self.list_date = attributes[:'listDate']
|
136
|
+
end
|
137
|
+
|
138
|
+
if attributes[:'agent']
|
139
|
+
self.agent = attributes[:'agent']
|
140
|
+
end
|
141
|
+
|
142
|
+
if attributes[:'modified']
|
143
|
+
self.modified = attributes[:'modified']
|
144
|
+
end
|
145
|
+
|
146
|
+
if attributes[:'school']
|
147
|
+
self.school = attributes[:'school']
|
148
|
+
end
|
149
|
+
|
150
|
+
if attributes[:'sales']
|
151
|
+
self.sales = attributes[:'sales']
|
152
|
+
end
|
153
|
+
|
154
|
+
if attributes[:'photos']
|
155
|
+
if (value = attributes[:'photos']).is_a?(Array)
|
156
|
+
self.photos = value
|
157
|
+
end
|
158
|
+
end
|
159
|
+
|
160
|
+
if attributes[:'listPrice']
|
161
|
+
self.list_price = attributes[:'listPrice']
|
162
|
+
end
|
163
|
+
|
164
|
+
if attributes[:'listingId']
|
165
|
+
self.listing_id = attributes[:'listingId']
|
166
|
+
end
|
167
|
+
|
168
|
+
if attributes[:'mls']
|
169
|
+
self.mls = attributes[:'mls']
|
170
|
+
end
|
171
|
+
|
172
|
+
if attributes[:'geo']
|
173
|
+
self.geo = attributes[:'geo']
|
174
|
+
end
|
175
|
+
|
176
|
+
if attributes[:'tax']
|
177
|
+
self.tax = attributes[:'tax']
|
178
|
+
end
|
179
|
+
|
180
|
+
if attributes[:'remarks']
|
181
|
+
self.remarks = attributes[:'remarks']
|
182
|
+
end
|
183
|
+
|
184
|
+
if attributes[:'privateRemarks']
|
185
|
+
self.private_remarks = attributes[:'privateRemarks']
|
186
|
+
end
|
187
|
+
|
188
|
+
if attributes[:'leaseTerm']
|
189
|
+
self.lease_term = attributes[:'leaseTerm']
|
190
|
+
end
|
191
|
+
|
192
|
+
if attributes[:'leaseType']
|
193
|
+
self.lease_type = attributes[:'leaseType']
|
194
|
+
end
|
195
|
+
|
196
|
+
end
|
197
|
+
|
198
|
+
end
|
199
|
+
end
|