Class: Cuprum::Cli::Errors::Files::FileNotWriteable

Inherits:
Error
  • Object
show all
Defined in:
lib/cuprum/cli/errors/files/file_not_writeable.rb

Overview

Error returned when attempting to generate a file in an invalid location.

Constant Summary collapse

TYPE =

Short string used to identify the type of error.

'cuprum.cli.errors.files.file_not_writeable'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file_path:, message: nil, reason: nil) ⇒ FileNotWriteable

Returns a new instance of FileNotWriteable.

Parameters:

  • file_path (String)

    the path to the expected file.

  • message (String) (defaults to: nil)

    message describing the nature of the error.

  • reason (String) (defaults to: nil)

    additional details on the error.



16
17
18
19
20
21
22
# File 'lib/cuprum/cli/errors/files/file_not_writeable.rb', line 16

def initialize(file_path:, message: nil, reason: nil)
  @file_path = file_path
  @reason    = reason
  message    = default_message(file_path:, message:, reason:)

  super
end

Instance Attribute Details

#file_pathString (readonly)

Returns the path to the expected file.

Returns:

  • (String)

    the path to the expected file.



25
26
27
# File 'lib/cuprum/cli/errors/files/file_not_writeable.rb', line 25

def file_path
  @file_path
end

#reasonString (readonly)

Returns additional details on the error.

Returns:

  • (String)

    additional details on the error.



28
29
30
# File 'lib/cuprum/cli/errors/files/file_not_writeable.rb', line 28

def reason
  @reason
end