Class: FileContainer

Inherits:
Array
  • Object
show all
Defined in:
lib/FileContainer.rb

Overview

FileContainer is a container for holding files, files can then be retrieved either by a number or a name retrieving by number is necessary when multiple files can have the same name (which is possible on CBM disks especially)

Instance Method Summary collapse

Instance Method Details

#[](index) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
# File 'lib/FileContainer.rb', line 7

def [](index)
  return super(index) if index.kind_of?(Integer)
  each do |f| 
    if f.respond_to?(:full_filename)
      return f if f.full_filename.upcase==index.upcase
    else 
      puts "not a file - #{f.class}"
    end
  end
  nil
end