Class: Uur::EntriesFileReader

Inherits:
Object
  • Object
show all
Defined in:
lib/uur/entries_file_reader.rb

Constant Summary collapse

CannotReadException =
Class.new(Exception)

Instance Method Summary collapse

Constructor Details

#initialize(entries_file_path) ⇒ EntriesFileReader

Returns a new instance of EntriesFileReader.



6
7
8
# File 'lib/uur/entries_file_reader.rb', line 6

def initialize(entries_file_path)
  @entries_file_path = entries_file_path
end

Instance Method Details

#readObject



10
11
12
13
14
# File 'lib/uur/entries_file_reader.rb', line 10

def read
  File.read(@entries_file_path)
rescue
  raise CannotReadException, "Cannot read the entries file: #{@entries_file_path}"
end