Sha256: 59874c5152459f3e02aa4e7ba89736165fb20191e2f8e94ce971aaa61bab50f5

Contents?: true

Size: 718 Bytes

Versions: 18

Compression:

Stored size: 718 Bytes

Contents

module Mollie
  class Order
    class Shipment < Base
      attr_accessor :id,
                    :order_id,
                    :created_at,
                    :tracking,
                    :lines,
                    :_links

      alias links _links

      def tracking
        @tracking || OpenStruct.new
      end

      def tracking=(tracking)
        @tracking = OpenStruct.new(tracking) if tracking.is_a?(Hash)
      end

      def lines=(lines)
        @lines = lines.map { |line| Order::Line.new(line) }
      end

      def created_at=(created_at)
        @created_at = Time.parse(created_at.to_s)
      end

      def order(options = {})
        Order.get(order_id, options)
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
mollie-api-ruby-4.14.0 lib/mollie/order/shipment.rb
mollie-api-ruby-4.7.1 lib/mollie/order/shipment.rb
mollie-api-ruby-4.7.0 lib/mollie/order/shipment.rb
mollie-api-ruby-4.6.2 lib/mollie/order/shipment.rb
mollie-api-ruby-4.6.1 lib/mollie/order/shipment.rb
mollie-api-ruby-4.6.0 lib/mollie/order/shipment.rb
mollie-api-ruby-4.5.0 lib/mollie/order/shipment.rb
mollie-api-ruby-4.4.1 lib/mollie/order/shipment.rb
mollie-api-ruby-4.4.0 lib/mollie/order/shipment.rb
mollie-api-ruby-4.3.1 lib/mollie/order/shipment.rb
mollie-api-ruby-4.3.0 lib/mollie/order/shipment.rb
mollie-api-ruby-4.2.0 lib/mollie/order/shipment.rb
mollie-api-ruby-4.1.5 lib/mollie/order/shipment.rb
mollie-api-ruby-4.1.4 lib/mollie/order/shipment.rb
mollie-api-ruby-4.1.3 lib/mollie/order/shipment.rb
mollie-api-ruby-4.1.2 lib/mollie/order/shipment.rb
mollie-api-ruby-4.1.1 lib/mollie/order/shipment.rb
mollie-api-ruby-4.1.0 lib/mollie/order/shipment.rb