Exception: Uniword::InvalidFormatError

Inherits:
Error
  • Object
show all
Defined in:
lib/uniword/errors.rb

Overview

Raised when a file format is invalid or unsupported

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path, format) ⇒ InvalidFormatError

Returns a new instance of InvalidFormatError.

Parameters:

  • path (String)

    The file path

  • format (Symbol, String)

    The invalid format



23
24
25
26
27
# File 'lib/uniword/errors.rb', line 23

def initialize(path, format)
  super("Invalid or unsupported format '#{format}' for file: #{path}")
  @path = path
  @format = format
end

Instance Attribute Details

#formatSymbol, String (readonly)

Returns The format.

Returns:

  • (Symbol, String)

    The format



33
34
35
# File 'lib/uniword/errors.rb', line 33

def format
  @format
end

#pathString (readonly)

Returns The file path.

Returns:

  • (String)

    The file path



30
31
32
# File 'lib/uniword/errors.rb', line 30

def path
  @path
end