Class: Duracloud::Commands::Count

Inherits:
Command
  • Object
show all
Defined in:
lib/duracloud/commands/count.rb

Instance Method Summary collapse

Methods inherited from Command

call, #cli

Instance Method Details

#callObject



4
5
6
7
8
9
10
11
12
# File 'lib/duracloud/commands/count.rb', line 4

def call
  space = Duracloud::Space.find(space_id, store_id)
  count = if prefix || space.count == 1000
            space.content_ids(prefix: prefix).to_a.length
          else
            space.count
          end
  puts count
end