Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Moved from listing.kind to listing.type

  • Loading branch information...
commit 0fae7a39224436f43bc1644967b539e1e2e4f354 1 parent 1893897
@malomalo malomalo authored
View
6 lib/mls/models/address.rb
@@ -48,7 +48,7 @@ class MLS::Address < MLS::Resource
property :avatar_digest, String, :serialize => false
- attr_accessor :listings, :listing_kinds, :photos, :videos
+ attr_accessor :listings, :listing_types, :photos, :videos
# should include an optional use address or no_image image
def avatar(size='100x200', protocol='http')
@@ -159,8 +159,8 @@ def listings=(listings)
}
end
- def listing_kinds=(listing_kinds)
- @object.listing_kinds = listing_kinds
+ def listing_types=(listing_types)
+ @object.listing_types = listing_types
end
def photos=(photos)
View
12 lib/mls/models/listing.rb
@@ -1,7 +1,7 @@
class MLS::Listing < MLS::Resource
STATES = %w(processing listed leased expired)
- KINDS = %w(lease sublease coworking)
+ TYPES = %w(lease sublease coworking_space)
SPACE_TYPES = %w(unit floor building)
LEASE_TERMS = ['Full Service', 'NNN', 'Modified Gross']
RATE_UNITS = ['ft^2/year', 'ft^2/month', 'month', 'year', 'desk/month']
@@ -21,7 +21,7 @@ class MLS::Listing < MLS::Resource
property :channel, String, :serialize => :if_present
property :name, String
- property :kind, String, :default => 'lease'
+ property :type, String, :default => 'lease'
property :state, String, :default => 'listed'
property :space_type, String, :default => 'unit'
property :unit, String
@@ -76,8 +76,14 @@ def avatar(size='150x100', protocol='http')
end
end
+ def lease?
+ type == 'lease'
+ end
def sublease?
- kind == 'sublease'
+ type == 'sublease'
+ end
+ def coworking?
+ type == 'coworking_space'
end
def leased?
View
2  mls.gemspec
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
Gem::Specification.new do |s|
s.name = "mls"
- s.version = '0.2.12'
+ s.version = '0.2.13'
s.authors = ["James R. Bracy"]
s.email = ["james@42floors.com"]
s.homepage = "http://mls.42floors.com"
View
4 test/factories/listing.rb
@@ -17,13 +17,13 @@
total_size { Kernel.rand(3000..900000) }
maximum_contiguous_size { Kernel.rand(3000..900000) }
minimum_divisable_size { Kernel.rand(3000..900000) }
- kind 'lease'
+ type 'lease'
#lease_terms { ::MLS::Listing::LEASE_TERMS.sample }
space_type 'unit'
rate { rand(15..300) }
available_on { Time.now + (20 + rand(0..360).to_i).days }
sublease_expiration { |l| l.sublease? ? (l.available_on + (30 + Kernel.rand(10..360)).days) : nil }
- name { |l| l.kind == 'coworking' ? Faker::Name.name : nil }
+ name { |l| l.type == 'coworking_space' ? Faker::Name.name : nil }
end
end
View
2  test/units/models/test_listing.rb
@@ -12,7 +12,7 @@ def test_properties
assert listing.respond_to?(:account_id)
assert listing.respond_to?(:hidden)
assert listing.respond_to?(:name)
- assert listing.respond_to?(:kind)
+ assert listing.respond_to?(:type)
assert listing.respond_to?(:space_type)
assert listing.respond_to?(:unit)
assert listing.respond_to?(:floor)
Please sign in to comment.
Something went wrong with that request. Please try again.