Sha256: aa5f4b29ea539dfb49584e50b7a610b3a132fea2e797556f6574e33ab0213469

Contents?: true

Size: 804 Bytes

Versions: 31

Compression:

Stored size: 804 Bytes

Contents

# frozen_string_literal: true

module FriendlyShipping
  class Carrier
    attr_reader :id, :name, :code, :shipping_methods, :balance, :data

    # @param [Integer] id The carrier's ID
    # @param [String] name The carrier's name
    # @param [String] code The carrier's unique code
    # @param [Array] shipping_methods The shipping methods available on this carrier
    # @param [Float] balance The remaining balance for this carrier
    # @param [Hash] data Additional data related to this carrier
    def initialize(id: nil, name: nil, code: nil, shipping_methods: [], balance: nil, data: {})
      @id = id
      @name = name
      @code = code
      @shipping_methods = shipping_methods
      @balance = balance
      @data = data
    end

    def ==(other)
      id == other.id
    end
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
friendly_shipping-0.8.1 lib/friendly_shipping/carrier.rb
friendly_shipping-0.8.0 lib/friendly_shipping/carrier.rb
friendly_shipping-0.7.3 lib/friendly_shipping/carrier.rb
friendly_shipping-0.7.2 lib/friendly_shipping/carrier.rb
friendly_shipping-0.7.1 lib/friendly_shipping/carrier.rb
friendly_shipping-0.7.0 lib/friendly_shipping/carrier.rb
friendly_shipping-0.6.5 lib/friendly_shipping/carrier.rb
friendly_shipping-0.6.4 lib/friendly_shipping/carrier.rb
friendly_shipping-0.6.3 lib/friendly_shipping/carrier.rb
friendly_shipping-0.6.2 lib/friendly_shipping/carrier.rb
friendly_shipping-0.6.1 lib/friendly_shipping/carrier.rb
friendly_shipping-0.6.0 lib/friendly_shipping/carrier.rb
friendly_shipping-0.5.3 lib/friendly_shipping/carrier.rb
friendly_shipping-0.5.2 lib/friendly_shipping/carrier.rb
friendly_shipping-0.5.1 lib/friendly_shipping/carrier.rb
friendly_shipping-0.5 lib/friendly_shipping/carrier.rb
friendly_shipping-0.4.14 lib/friendly_shipping/carrier.rb
friendly_shipping-0.4.13 lib/friendly_shipping/carrier.rb
friendly_shipping-0.4.12 lib/friendly_shipping/carrier.rb
friendly_shipping-0.4.11 lib/friendly_shipping/carrier.rb