Sha256: d27e2a0b4e37ef01bf3923df6d4b63a7a1c8e56f2d4ac63a111599e7613ba51f
Contents?: true
Size: 563 Bytes
Versions: 6
Compression:
Stored size: 563 Bytes
Contents
module Kosher class Seller < Struct.new(:merchant_id, :average_rating) class << self attr_accessor :blacklist def build(doc) merchant_id = doc['MerchantId'] average_rating = doc['AverageFeedbackRating'].to_f new(merchant_id, average_rating) end end def blacklist self.class.blacklist end def blacklisted? blacklist.include? merchant_id rescue false end def kosher? return false if blacklisted? average_rating == 0.0 || average_rating > 4.7 end end end
Version data entries
6 entries across 6 versions & 1 rubygems