Class: Arv::Collection::CollectionFile

Inherits:
CollectionItem show all
Defined in:
lib/arvados/collection.rb

Instance Attribute Summary

Attributes inherited from CollectionItem

#name, #path

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ CollectionFile

Returns a new instance of CollectionFile.



233
234
235
236
# File 'lib/arvados/collection.rb', line 233

def initialize(path)
  super
  @segments = []
end

Class Method Details

.human_nameObject



238
239
240
# File 'lib/arvados/collection.rb', line 238

def self.human_name
  "file"
end

Instance Method Details

#add_segment(segment) ⇒ Object



250
251
252
# File 'lib/arvados/collection.rb', line 250

def add_segment(segment)
  @segments << segment
end

#check_can_add_copy(src_item, name) ⇒ Object Also known as: check_can_merge

Raises:

  • (Errno::ENOTDIR)


258
259
260
# File 'lib/arvados/collection.rb', line 258

def check_can_add_copy(src_item, name)
  raise Errno::ENOTDIR.new(path)
end

#copy_named(copy_path) ⇒ Object



264
265
266
267
268
# File 'lib/arvados/collection.rb', line 264

def copy_named(copy_path)
  copy = self.class.new(copy_path)
  each_segment { |segment| copy.add_segment(segment) }
  copy
end

#each_segment(&block) ⇒ Object



254
255
256
# File 'lib/arvados/collection.rb', line 254

def each_segment(&block)
  @segments.each(&block)
end

#file?Boolean

Returns:

  • (Boolean)


242
243
244
# File 'lib/arvados/collection.rb', line 242

def file?
  true
end

#leaf?Boolean

Returns:

  • (Boolean)


246
247
248
# File 'lib/arvados/collection.rb', line 246

def leaf?
  true
end