mls 0.5.5 → 0.5.6

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: ee422d34ce4942f4bfd3ad3628f8a8046f3220a5
4
- data.tar.gz: 6fbbe17e89272505e4d63cdf01c891d3d2dd79f1
3
+ metadata.gz: 48488e5e700d96431a1f1c963ba820bbf5e5377c
4
+ data.tar.gz: f65241be79369c26998a9a14a399c33c9874cd69
5
5
  SHA512:
6
- metadata.gz: 8635fff51986e8e12ea2838230852b30a665ab212e9d59d9121310739a0970034230a7eba375ab3f690325ab79272f2206146ec9a44ca53609a7a18e2bdf76fe
7
- data.tar.gz: 3c2520c00e41953750b89d7113e5f9372726186de6e7a2b8880322f65b07564de2b4ef426af9f4ec962a3cedb372ae00352d5adb61af972e72b1743941f05c21
6
+ metadata.gz: 9278315dcc461af3a2bb6ab93aa8d1518723d3602d1f77b096badbad117e20712bef78359fbc52afc2af1e3d82d165f8022abec839b6a97e535e9e8d14e35cc7
7
+ data.tar.gz: 87ae8fcdc210dc41a062f368d050550a436c80ef8fedaa988d02755bc402fe7650df0b0f2395a51e104f01e4ff81a938407c6c2e5776405f1a98a47211f481cc
data/.gitignore CHANGED
@@ -5,3 +5,5 @@ pkg/*
5
5
  .rvmrc
6
6
  coverage
7
7
  doc
8
+ *#*
9
+ *~
data/lib/mls.rb CHANGED
@@ -24,7 +24,7 @@ class MLS
24
24
  API_VERSION = '0.1.0'
25
25
 
26
26
  attr_reader :url, :user_agent
27
- attr_writer :asset_host, :image_host, :listing_amenities, :address_amenities
27
+ attr_writer :asset_host, :image_host, :agent_profile, :listing_amenities, :address_amenities
28
28
  attr_accessor :api_key, :auth_key, :logger
29
29
 
30
30
  # Sets the API Token and Host of the MLS Server
@@ -72,6 +72,11 @@ class MLS
72
72
  .parse(MLS.get('/listings/amenities').body)
73
73
  end
74
74
 
75
+ def agent_profile(id)
76
+ @agent_profile = Yajl::Parser.new(:symbolize_keys => true)
77
+ .parse(MLS.get("/agents/#{id}").body)
78
+ end
79
+
75
80
  def address_amenities
76
81
  @address_amenities ||= Yajl::Parser.new(:symbolize_keys => true)
77
82
  .parse(MLS.get('/addresses/amenities').body)
@@ -26,6 +26,7 @@ class MLS::Account < MLS::Resource
26
26
  property :created_at, DateTime, :serialize => :false
27
27
  property :updated_at, DateTime, :serialize => :false
28
28
 
29
+ property :email_token, String, :serialize => false
29
30
  property :auth_key, String, :serialize => false
30
31
 
31
32
  exclude_from_comparison :password, :password_confirmation
@@ -66,7 +67,11 @@ class MLS::Account < MLS::Resource
66
67
  response = MLS.get('/account/favorites')
67
68
  @favorites = MLS::Listing::Parser.parse_collection(response.body, {:collection_root_element => :favorites})
68
69
  end
69
-
70
+
71
+ def agent_profile
72
+ @agent_profile ||= MLS.agent_profile id
73
+ end
74
+
70
75
  def favorited?(listing)
71
76
  favorites.include?(listing)
72
77
  end
@@ -35,6 +35,8 @@ class MLS::Listing < MLS::Resource
35
35
  property :lease_terms, String
36
36
  property :rate, Decimal
37
37
  property :rate_units, String, :default => '/sqft/mo'
38
+ property :low_rate, Decimal, :serialize => :false
39
+ property :high_rate, Decimal, :serialize => :false
38
40
  property :rate_per_sqft_per_month, Decimal, :serialize => :false # need to make write methods for these that set rate to the according rate units. not accepted on api
39
41
  property :rate_per_sqft_per_year, Decimal, :serialize => :false
40
42
  property :rate_per_month, Decimal, :serialize => :false
@@ -65,9 +67,14 @@ class MLS::Listing < MLS::Resource
65
67
 
66
68
  property :created_at, DateTime, :serialize => :false
67
69
  property :updated_at, DateTime, :serialize => :false
68
- property :touched_at, DateTime, :serialize => :false
70
+ property :touched_at, DateTime, :serialize => :false
69
71
  property :leased_on, DateTime
70
-
72
+ property :photography_requested_on, DateTime, :serialize => :false
73
+
74
+ property :awesome_score, Fixnum
75
+ property :awesome_needs, Array, :serialize => :if_present
76
+ property :awesome_label, String
77
+
71
78
  property :flyer_id, Fixnum, :serialize => :if_present
72
79
  property :floorplan_id, Fixnum, :serialize => :if_present
73
80
 
@@ -154,7 +161,7 @@ class MLS::Listing < MLS::Resource
154
161
  MLS::Tour.create(id, account, tour)
155
162
  end
156
163
 
157
-
164
+
158
165
  def create
159
166
  MLS.post('/listings', {:listing => to_hash}, 201, 400) do |response, code|
160
167
  raise MLS::Exception::UnexpectedResponse if ![201, 400].include?(code)
data/lib/mls/parser.rb CHANGED
@@ -54,6 +54,7 @@ class MLS::Parser
54
54
  def extract_attributes(data)
55
55
  Yajl::Parser.new(:symbolize_keys => true).parse(data)
56
56
  end
57
+
57
58
  def self.extract_attributes(data)
58
59
  Yajl::Parser.new(:symbolize_keys => true).parse(data)
59
60
  end
data/mls.gemspec CHANGED
@@ -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.5.5'
6
+ s.version = '0.5.6'
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.5.5
4
+ version: 0.5.6
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-24 00:00:00.000000000 Z
12
+ date: 2013-06-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake