Sha256: 9106e386615dd1ba46e8bc4942af2d759f3de50d5199aff91e8a75581b508443

Contents?: true

Size: 447 Bytes

Versions: 5

Compression:

Stored size: 447 Bytes

Contents

module ShipCompliant
  # == ShipCompliant::ShipmentSalesTaxRate
  #
  # ShipmentSalesTaxRate gives access about a shipment's freight and product tax
  # details.
  #
  # It also provides a helper method to find a product by its key.
  class ShipmentSalesTaxRate < Struct.new(:shipment_key, :freight, :products)

    def taxes_for_product(product_key)
      products.select { |product| product.product_key == product_key }.first
    end

  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
ship_compliant-0.2.1 lib/ship_compliant/shipment_sales_tax_rate.rb
ship_compliant-0.2.0 lib/ship_compliant/shipment_sales_tax_rate.rb
ship_compliant-0.1.2 lib/ship_compliant/shipment_sales_tax_rate.rb
ship_compliant-0.1.1 lib/ship_compliant/shipment_sales_tax_rate.rb
ship_compliant-0.1.0 lib/ship_compliant/shipment_sales_tax_rate.rb