Class: FileHandler

Inherits:
Object show all
Defined in:
lib/file_handler.rb

Class Method Summary collapse

Class Method Details

.get_file_contents(file_path) ⇒ Object



2
3
4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/file_handler.rb', line 2

def self.get_file_contents(file_path)
    begin
        text = Array.new
        File.open file_path do |file|
            while line = file.gets
                text << line
            end
        end
        text
    rescue Exception => e
        raise e.message
        puts e.backtrace.inspect
    end
end