Class: Brutal::File::Read

Inherits:
Object
  • Object
show all
Defined in:
lib/brutal/file/read.rb

Overview

Brutal::File::Read

Since:

  • 1.1.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ Read

Returns a new instance of Read.

Since:

  • 1.1.0



11
12
13
# File 'lib/brutal/file/read.rb', line 11

def initialize(name)
  @name = name
end

Instance Attribute Details

#nameObject (readonly)

Since:

  • 1.1.0



9
10
11
# File 'lib/brutal/file/read.rb', line 9

def name
  @name
end

Instance Method Details

#callObject

Since:

  • 1.1.0



15
16
17
18
19
# File 'lib/brutal/file/read.rb', line 15

def call
  ::File.read(path)
rescue ::Errno::ENOENT => _e
  abort "File #{path} not found!"
end