lib/mls.rb in mls-0.2.5 vs lib/mls.rb in mls-0.2.6

- old
+ new

@@ -22,11 +22,11 @@ include Singleton API_VERSION = '0.1.0' attr_reader :url - attr_writer :asset_host + attr_writer :asset_host, :listing_amenities, :address_amenities attr_accessor :api_key, :auth_key, :logger # Sets the API Token and Host of the MLS Server # # #!ruby @@ -51,10 +51,20 @@ # otherwise it queries the MLS for this configuration. def asset_host # TODO: testme @asset_host ||= get('/asset_host').body end + def listing_amenities + @listing_amenities ||= Yajl::Parser.new(:symbolize_keys => true) + .parse(MLS.get('/listings/amenities').body) + end + + def address_amenities + @address_amenities ||= Yajl::Parser.new(:symbolize_keys => true) + .parse(MLS.get('/addresses/amenities').body) + end + def headers # TODO: testme h = { 'Content-Type' => 'application/json', 'X-42Floors-API-Version' => API_VERSION, 'X-42Floors-API-Key' => api_key @@ -407,8 +417,9 @@ require 'mls/model' require 'mls/models/account' require 'mls/models/listing' require 'mls/models/address' require 'mls/models/photo' +require 'mls/models/pdf' require 'mls/models/tour_request' require 'mls/models/flyer' require 'mls/models/region'