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.
229 230 231 232 |
# File 'lib/arvados/collection.rb', line 229 def initialize(path) super @segments = [] end |
Class Method Details
.human_name ⇒ Object
234 235 236 |
# File 'lib/arvados/collection.rb', line 234 def self.human_name "file" end |
Instance Method Details
#add_segment(segment) ⇒ Object
246 247 248 |
# File 'lib/arvados/collection.rb', line 246 def add_segment(segment) @segments << segment end |
#check_can_add_copy(src_item, name) ⇒ Object Also known as: check_can_merge
254 255 256 |
# File 'lib/arvados/collection.rb', line 254 def check_can_add_copy(src_item, name) raise Errno::ENOTDIR.new(path) end |
#copy_named(copy_path) ⇒ Object
260 261 262 263 264 |
# File 'lib/arvados/collection.rb', line 260 def copy_named(copy_path) copy = self.class.new(copy_path) each_segment { |segment| copy.add_segment(segment) } copy end |
#each_segment(&block) ⇒ Object
250 251 252 |
# File 'lib/arvados/collection.rb', line 250 def each_segment(&block) @segments.each(&block) end |
#file? ⇒ Boolean
238 239 240 |
# File 'lib/arvados/collection.rb', line 238 def file? true end |
#leaf? ⇒ Boolean
242 243 244 |
# File 'lib/arvados/collection.rb', line 242 def leaf? true end |