Sha256: fbf86ceed67c52e906c76f58d6ef4b5cfe58a71729f6f128ebaaf043edfacfce

Contents?: true

Size: 416 Bytes

Versions: 5

Compression:

Stored size: 416 Bytes

Contents

require "csv"

module Duracloud::Commands
  class ListItems < Command

    HEADERS = %i( content_id md5 size content_type modified )

    def call
      CSV.instance($stdout, headers: HEADERS, write_headers: true) do |csv|
        Duracloud::Space.items(space_id, store_id: store_id, prefix: prefix).each do |item|
          csv << HEADERS.map { |header| item.send(header) }
        end
      end
    end

  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
duracloud-client-0.10.2 lib/duracloud/commands/list_items.rb
duracloud-client-0.10.1 lib/duracloud/commands/list_items.rb
duracloud-client-0.10.0 lib/duracloud/commands/list_items.rb
duracloud-client-0.9.1 lib/duracloud/commands/list_items.rb
duracloud-client-0.9.0 lib/duracloud/commands/list_items.rb