Skip to content

Commit

Permalink
Adding regions
Browse files Browse the repository at this point in the history
  • Loading branch information
waratuman committed Oct 8, 2012
1 parent 728107c commit 9324ad6
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 28 deletions.
2 changes: 1 addition & 1 deletion lib/mls.rb
Expand Up @@ -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'
27 changes: 0 additions & 27 deletions lib/mls/models/area.rb

This file was deleted.

33 changes: 33 additions & 0 deletions lib/mls/models/region.rb
@@ -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.