Sha256: 7746399adc75ef968cefdd6cb42803f4b027d8563ab685eab3d19c8c5682e25f

Contents?: true

Size: 891 Bytes

Versions: 3

Compression:

Stored size: 891 Bytes

Contents

class MLS::Address < MLS::Resource

  property :id, Fixnum
  property :name, String
  property :slug, String
  
  property :latitude, Decimal
  property :longitude, Decimal
  
  property :formatted_address, String
  property :street_number, String
  property :street, String
  property :neighborhood, String
  property :city, String
  property :county, String
  property :state, String
  property :country, String
  property :postal_code, String

  class << self
    
    def query(q)
      response = MLS.get('/addresses/query', :query => q)
      MLS::Address::Parser.parse_collection(response.body)
    end

    # Bounds is passed as 'n,e,s,w' or [n, e, s, w]
    def box_cluster(bounds, zoom, filters={})
      response = MLS.get('/addresses/box_cluster', :bounds => bounds, :zoom => zoom, :filters => filters)
    end
    
  end
  
end


class MLS::Address::Parser < MLS::Parser
  
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
mls-0.2.2 lib/mls/models/address.rb
mls-0.2.1 lib/mls/models/address.rb
mls-0.2.0 lib/mls/models/address.rb