Sha256: 8e08cfa123efce8f726294037930c3a0e596201cb0a4bb1afd46dfeed2f4fedc

Contents?: true

Size: 805 Bytes

Versions: 7

Compression:

Stored size: 805 Bytes

Contents

module Fassbinder
  class ShippingBuilder
    DEFAULT_SHIPPING_CENTS = { 'amazon.com'   => 399,
                               'amazon.co.uk' => 280,
                               'amazon.de'    => 299,
                               'amazon.ca'    => 649,
                               'amazon.fr'    => 300,
                               'amazon.co.jp' => 25000 }

    attr_reader :shipping

    def initialize
      @shipping = Kosher::Shipping.new
    end

    def add_availability(hours)
      availability = Kosher::Availability.new
      availability.hours = hours.to_i
      @shipping.availability = availability
    end

    def calculate_price(is_free, venue, currency)
      @shipping.cents = is_free ? 0 : DEFAULT_SHIPPING_CENTS[venue]
      @shipping.currency = currency
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
fassbinder-0.0.15 lib/fassbinder/shipping_builder.rb
fassbinder-0.0.14 lib/fassbinder/shipping_builder.rb
fassbinder-0.0.13 lib/fassbinder/shipping_builder.rb
fassbinder-0.0.12 lib/fassbinder/shipping_builder.rb
fassbinder-0.0.11 lib/fassbinder/shipping_builder.rb
fassbinder-0.0.10 lib/fassbinder/shipping_builder.rb
fassbinder-0.0.9 lib/fassbinder/shipping_builder.rb