lib/kosher/shipping.rb in kosher-0.10.0 vs lib/kosher/shipping.rb in kosher-0.11.0

- old
+ new

@@ -1,25 +1,10 @@ module Kosher class Shipping < Structure - include ActiveModel::Validations + include Base + include Price - key :available - key :cents, Integer - key :currency - key :kosher, Boolean, :default => true + key :available, Boolean - validates_presence_of :currency, :available - validates_numericality_of :cents, - :greater_than => 0 - - # Shipping cost. - def cost - Money.new(cents, currency) - end - - # Returns whether the item is kosher. - def kosher? - raise Invalid.new(self) unless valid? - kosher - end + validates_presence_of :available end end