Class: FluidigmFile::Finder::Directory

Inherits:
Object
  • Object
show all
Defined in:
app/models/fluidigm_file.rb

Instance Method Summary collapse

Constructor Details

#initialize(barcode) ⇒ Directory

Returns a new instance of Directory.



5
6
7
# File 'app/models/fluidigm_file.rb', line 5

def initialize(barcode)
  @barcode = barcode
end

Instance Method Details

#contentObject



13
14
15
16
17
18
19
# File 'app/models/fluidigm_file.rb', line 13

def content
  file_content = nil
  File.open("#{configatron.fluidigm_data.directory}/#{@barcode}/#{@barcode}.csv") do |file|
    file_content = file.read
  end
  file_content
end

#empty?Boolean

Returns:

  • (Boolean)


9
10
11
# File 'app/models/fluidigm_file.rb', line 9

def empty?
  !File.exist?("#{configatron.fluidigm_data.directory}/#{@barcode}/#{@barcode}.csv")
end