mls 0.9.3 → 0.9.4

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: 55ceae02934c61630d9e23181c359da1ce075633
4
- data.tar.gz: 26d8d07be91e95768f9db4625404f7c3da206026
3
+ metadata.gz: ff09dafc90a6ff857a40f593ba4f0c978c36bb31
4
+ data.tar.gz: ff991984c50826e07e700a37b67466632fc8be18
5
5
  SHA512:
6
- metadata.gz: d597e470445d8695113a62ff6003c2550077368b362a152bf3ef05c46d12c40436ce12dbd16ae72199d3030142c6e021004a2fc3f25fa987aa016ee2bfc87906
7
- data.tar.gz: fd3d6f772d3a27a6b06ee4b061f4264794db487a7a50ee7da7cf0c16242e0fc195339b5055671eb70fbf88fcc097988d441ad3b4cd9f0ccbacd74cfafbf1cd6e
6
+ metadata.gz: fac30e5dbb965e6f5de1db007f22c4121b0b08a1385bb61ad63510acd7b23840c25379d40f01f464162b119471f5654253d577b25936d75fb1cddf6b1e3c89b4
7
+ data.tar.gz: 26ab3dcd0c351b104d55a887b78f1792b5cabe8a7d4b9f366f1db72f3227b620aad003d4e5ffd0f6a3aff3183c599fa0e1283043635dd66a2436c5f62d82db6b
@@ -154,6 +154,7 @@ class MLS::Listing < MLS::Resource
154
154
 
155
155
  # TODO: remove /desk/mo conversions
156
156
  def rate(units='/sqft/mo')
157
+ return nil if !@rate
157
158
 
158
159
  price = if rate_units == '/sqft/mo'
159
160
  if units == '/sqft/mo'
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.9.3'
6
+ s.version = '0.9.4'
7
7
  s.authors = ["James R. Bracy", "Jon Bracy"]
8
8
  s.email = ["james@42floors.com"]
9
9
  s.homepage = "http://mls.42floors.com"
@@ -257,5 +257,17 @@ class TestListing < ::Test::Unit::TestCase
257
257
  assert_equal 235, listing.rate('/yr')
258
258
  assert_equal 783.33, listing.rate('/desk/mo')
259
259
  end
260
+
261
+ def test_null_rate
262
+ listing = MLS::Listing.new(:rate => nil, :rate_units => '/yr', :size => 5)
263
+
264
+ assert_equal nil, listing.rate
265
+ assert_equal nil, listing.rate('/sqft/mo')
266
+ assert_equal nil, listing.rate('/sqft/yr')
267
+ assert_equal nil, listing.rate('/mo')
268
+ assert_equal nil, listing.rate('/yr')
269
+ assert_equal nil, listing.rate('/desk/mo')
270
+ assert_equal nil, listing.rate('/random')
271
+ end
260
272
 
261
273
  end
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.9.3
4
+ version: 0.9.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - James R. Bracy