Exception: FileNotFoundException

Inherits:
StandardError
  • Object
show all
Defined in:
lib/custom_exceptions.rb

Overview

class to implement a friendly exception for file not found rather than ErrNoEnt

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file_name) ⇒ FileNotFoundException

Returns a new instance of FileNotFoundException.


7
8
9
# File 'lib/custom_exceptions.rb', line 7

def initialize(file_name)
  @file_name = file_name
end

Instance Attribute Details

#file_nameObject (readonly)

Returns the value of attribute file_name


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

def file_name
  @file_name
end

Instance Method Details

#to_sObject


11
12
13
# File 'lib/custom_exceptions.rb', line 11

def to_s
  "#{I18n.t :file_not_found}: #{file_name}"
end