Sha256: b5368ba2443273d65503a0013028ded54bd4b66bddd994d4b6f8ac4db83702bc
Contents?: true
Size: 541 Bytes
Versions: 2
Compression:
Stored size: 541 Bytes
Contents
module Kosher class Shipping < Structure include ActiveModel::Validations key :available key :cents, Integer key :currency key :kosher, Boolean, :default => true 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 end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
kosher-0.10.0 | lib/kosher/shipping.rb |
kosher-0.9.1 | lib/kosher/shipping.rb |