lib/shoppr/store.rb in shoppr-0.1.1 vs lib/shoppr/store.rb in shoppr-0.2.3

- old
+ new

@@ -1,18 +1,14 @@ module Shoppr class Store - include ROXML - xml_convention {|val| val.camelize(:lower) } - xml_reader :id, :from => '@id', :as => Integer - xml_reader :name - xml_reader :logo, :as => Image - xml_reader :phone_number - xml_reader :trusted?, :from => :attr - xml_reader :authorized_reseller?, :from => :attr - xml_reader :country_flag, :as => Image - xml_reader :country_code, :from => 'countryFlag/countryCode' - xml_reader :review_count, :as => Integer, :from => 'ratingInfo/reviewCount' - xml_reader :rating, :as => Float, :from => 'ratingInfo/rating' - xml_reader :rating_image, :as => Image, :from => 'ratingInfo/ratingImage' - xml_reader :review_url, :from => 'ratingInfo/reviewURL' + + attr_accessor :rating, :review_count, :rating_image + + def initialize(cat_mash) + Shoppr.map_mash_attrs(self, cat_mash) + + @rating = self.rating_info.rating + @review_count = self.rating_info.reviewCount + end + end end \ No newline at end of file