Permalink
Browse files

Adding regions

  • Loading branch information...
1 parent 728107c commit 9324ad6789b4a727e55a9286cedb789f11233fb1 @waratuman waratuman committed Oct 8, 2012
Showing with 34 additions and 28 deletions.
  1. +1 −1 lib/mls.rb
  2. +0 −27 lib/mls/models/area.rb
  3. +33 −0 lib/mls/models/region.rb
View
@@ -411,4 +411,4 @@ def self.parse(json) # TODO: testme
require 'mls/models/photo'
require 'mls/models/tour_request'
require 'mls/models/flyer'
-require 'mls/models/area'
+require 'mls/models/region'
View
@@ -1,27 +0,0 @@
-class MLS::Area < MLS::Resource
-
- property :id, Fixnum, :serialize => :if_present
- property :name, String, :serialize => :if_present
- property :level, Fixnum, :serialize => :if_present
- property :type, String, :serialize => :if_present
- property :source, String, :serialize => :if_present
- property :geometry, Hash, :serialize => false
-
- # Counter caches
- property :listings_count, Fixnum, :serialize => :false
-
- class << self
-
- def find(id)
- response = MLS.get("/areas/#{id}")
- MLS::Area::Parser.parse(response.body)
- end
-
- end
-
-end
-
-
-class MLS::Area::Parser < MLS::Parser
-
-end
View
@@ -0,0 +1,33 @@
+class MLS::Region < MLS::Resource
+
+ property :id, Fixnum, :serialize => :if_present
+ property :name, String, :serialize => :if_present
+ property :common_name, String, :serialize => :if_present
+ property :description, String, :serialize => :if_present
+ property :code, String, :serialize => :if_present
+ property :type, String, :serialize => :if_present
+ property :source, String, :serialize => :if_present
+ property :minimum_zoom, Fixnum, :serialize => :if_present
+ property :maximum_zoom, Fixnum, :serialize => :if_present
+ property :slug, String, :serialize => false
+ property :geometry, Hash, :serialize => false
+ property :envelope, Hash, :serialize => false
+
+ # Counter caches
+ property :listings_count, Fixnum, :serialize => :false
+
+ class << self
+
+ def find(id)
+ response = MLS.get("/regions/#{id}")
+ MLS::Region::Parser.parse(response.body)
+ end
+
+ end
+
+end
+
+
+class MLS::Region::Parser < MLS::Parser
+
+end

0 comments on commit 9324ad6

Please sign in to comment.