Class: Brutal::File::Read

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

Overview

Brutal::File::Read

Since:

  • 1.1.0

Constant Summary collapse

NAME =

Since:

  • 1.1.0

".brutal.yml"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name = NAME) ⇒ Read

Returns a new instance of Read.

Since:

  • 1.1.0


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

def initialize(name = NAME)
  @name = name
end

Instance Attribute Details

#nameObject (readonly)

Since:

  • 1.1.0


14
15
16
# File 'lib/brutal/file/read.rb', line 14

def name
  @name
end

Instance Method Details

#callObject

Since:

  • 1.1.0


20
21
22
23
24
# File 'lib/brutal/file/read.rb', line 20

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