Exception: OpenTopo::Errors::FileError
- Defined in:
- lib/open_topo/errors/file_error.rb
Instance Attribute Summary collapse
-
#file_path ⇒ Object
readonly
Returns the value of attribute file_path.
Instance Method Summary collapse
- #file ⇒ Object
-
#initialize(message = "", file_path: nil) ⇒ FileError
constructor
A new instance of FileError.
Constructor Details
#initialize(message = "", file_path: nil) ⇒ FileError
Returns a new instance of FileError.
8 9 10 11 |
# File 'lib/open_topo/errors/file_error.rb', line 8 def initialize( = "", file_path: nil) super() @file_path = file_path end |
Instance Attribute Details
#file_path ⇒ Object (readonly)
Returns the value of attribute file_path.
6 7 8 |
# File 'lib/open_topo/errors/file_error.rb', line 6 def file_path @file_path end |
Instance Method Details
#file ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/open_topo/errors/file_error.rb', line 13 def file return nil if @file_path.nil? File.open(@file_path) rescue Errno::ENOENT nil end |