Exception: Kotoshu::InvalidDictionaryFormatError

Inherits:
Error
  • Object
show all
Defined in:
lib/kotoshu/core/exceptions.rb

Overview

Error raised when a dictionary file has an invalid format.

Examples:

Invalid dictionary format

raise InvalidDictionaryFormatError, "Invalid .dic file format"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path, details = nil) ⇒ InvalidDictionaryFormatError

Create a new invalid format error.

Parameters:

  • path (String)

    The file path

  • details (String) (defaults to: nil)

    Details about the format issue



37
38
39
40
41
# File 'lib/kotoshu/core/exceptions.rb', line 37

def initialize(path, details = nil)
  @path = path
  @details = details
  super("Invalid dictionary format#{": #{details}" if details}: #{path}")
end

Instance Attribute Details

#detailsString? (readonly)

Returns Details about the format issue.

Returns:

  • (String, nil)

    Details about the format issue



47
48
49
# File 'lib/kotoshu/core/exceptions.rb', line 47

def details
  @details
end

#pathString (readonly)

Returns The file path.

Returns:

  • (String)

    The file path



44
45
46
# File 'lib/kotoshu/core/exceptions.rb', line 44

def path
  @path
end