Class: Referral::FileStore

Inherits:
Object
  • Object
show all
Defined in:
lib/referral/file_store.rb

Constant Summary collapse

GROSS_FILE_CACHE =
{}

Class Method Summary collapse

Class Method Details

.read_file(file) ⇒ Object



9
10
11
# File 'lib/referral/file_store.rb', line 9

def self.read_file(file)
  GROSS_FILE_CACHE[file] ||= File.read(file)
end

.read_line(file, line) ⇒ Object



5
6
7
# File 'lib/referral/file_store.rb', line 5

def self.read_line(file, line)
  read_file(file).split("\n")[line - 1]
end