Sha256: 3119e66815caaa53f00d341a8f6372ced8d5aafda905e0a33aaf19e9212e72ee

Contents?: true

Size: 464 Bytes

Versions: 3

Compression:

Stored size: 464 Bytes

Contents

# frozen_string_literal: true

require 'mws/orders/document'

module MWS
  module Orders
    # Returns a list of parsed objects
    class Collection < Document
      include Enumerable

      def each
        raise NotImplementedError
      end

      def empty?
        count.zero?
      end

      def attributes
        map(&:attributes)
      end

      def inspect
        "#<#{self.class.name} #{to_a}>"
      end

      alias to_s inspect
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
mws-orders-0.6.1 lib/mws/orders/collection.rb
mws-orders-0.5.1 lib/mws/orders/collection.rb
mws-orders-0.5.0 lib/mws/orders/collection.rb