Sha256: b3f322e1f5214efaa99037585db39487c78e10944867ef528a9d40f1e0027357

Contents?: true

Size: 521 Bytes

Versions: 32

Compression:

Stored size: 521 Bytes

Contents

module Dugway
  module Drops
    class ProductOptionDrop < BaseDrop
      def default
        position == 1
      end

      def has_custom_price
        price != product.default_price
      end

      # Make up inventory numbers since we obviously don't want that from the API

      def quantity
        @quantity ||= sold_out ? 0 : rand(100)
      end

      def sold
        @sold ||= rand(100)
      end

      def inventory
        ((quantity.to_f / (quantity + sold).to_f) * 100).round
      end
    end
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
dugway-0.11.4 lib/dugway/liquid/drops/product_option_drop.rb
dugway-0.11.3 lib/dugway/liquid/drops/product_option_drop.rb
dugway-0.11.2 lib/dugway/liquid/drops/product_option_drop.rb
dugway-0.11.1 lib/dugway/liquid/drops/product_option_drop.rb
dugway-0.11.0 lib/dugway/liquid/drops/product_option_drop.rb
dugway-0.10.5 lib/dugway/liquid/drops/product_option_drop.rb
dugway-0.10.4 lib/dugway/liquid/drops/product_option_drop.rb
dugway-0.10.3 lib/dugway/liquid/drops/product_option_drop.rb
dugway-0.10.2 lib/dugway/liquid/drops/product_option_drop.rb
dugway-0.10.1 lib/dugway/liquid/drops/product_option_drop.rb
dugway-0.10.0 lib/dugway/liquid/drops/product_option_drop.rb
dugway-0.9.0 lib/dugway/liquid/drops/product_option_drop.rb
dugway-0.8.4 lib/dugway/liquid/drops/product_option_drop.rb
dugway-0.8.3 lib/dugway/liquid/drops/product_option_drop.rb
dugway-0.8.2 lib/dugway/liquid/drops/product_option_drop.rb
dugway-0.8.1 lib/dugway/liquid/drops/product_option_drop.rb
dugway-0.8.0 lib/dugway/liquid/drops/product_option_drop.rb
dugway-0.7.1 lib/dugway/liquid/drops/product_option_drop.rb
dugway-0.7.0 lib/dugway/liquid/drops/product_option_drop.rb
dugway-0.6.7 lib/dugway/liquid/drops/product_option_drop.rb