Sha256: 0336ce6044b8c8a0f24f0d0521d6fe2dc36a3c28fcd1b2ed50aec2c3c0e28384
Contents?: true
Size: 601 Bytes
Versions: 8
Compression:
Stored size: 601 Bytes
Contents
module Kosher # The availability of an offer. # # This represents within how many hours an offer is expected to ship out. class Availability < Structure include Threshold key :hours, :type => Integer # Returns whether the availability is kosher. # # An availability is kosher if the item ships within a maximum threshold of # hours. # # If we do not know when an item will ship (e.g. Amazon's preorders), we # should set hours to nil, which will render the availability unkosher. def kosher? !hours.nil? && hours <= threshold end end end
Version data entries
8 entries across 8 versions & 1 rubygems