Class: Arv::Collection::CollectionFile
- Inherits:
-
CollectionItem
- Object
- CollectionItem
- Arv::Collection::CollectionFile
- Defined in:
- lib/arvados/collection.rb
Instance Attribute Summary
Attributes inherited from CollectionItem
Class Method Summary collapse
Instance Method Summary collapse
- #add_segment(segment) ⇒ Object
- #check_can_add_copy(src_item, name) ⇒ Object (also: #check_can_merge)
- #copy_named(copy_path) ⇒ Object
- #each_segment(&block) ⇒ Object
- #file? ⇒ Boolean
-
#initialize(path) ⇒ CollectionFile
constructor
A new instance of CollectionFile.
- #leaf? ⇒ Boolean
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_name ⇒ Object
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
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
242 243 244 |
# File 'lib/arvados/collection.rb', line 242 def file? true end |
#leaf? ⇒ Boolean
246 247 248 |
# File 'lib/arvados/collection.rb', line 246 def leaf? true end |