Exception: LibPath::Exceptions::MalformedNameException

Inherits:
LibPathBaseException show all
Defined in:
lib/libpath/exceptions/malformed_name_exception.rb

Overview

Exception thrown when a malformed name is encountered

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from LibPathBaseException

new

Constructor Details

#initialize(name, message = nil) ⇒ MalformedNameException

Initialises an instance from the given name and optional message

  • Parameters:

    • name (String) The name that is malformed

    • message (String) optional The message. If nil the message “malformed name ‘##name’” is used



65
66
67
68
69
70
71
72
73
74
75
# File 'lib/libpath/exceptions/malformed_name_exception.rb', line 65

def initialize name, message = nil

  unless message

    message = "malformed name '#{name}'"
  end

  super message

  @name = name
end

Instance Attribute Details

#nameObject (readonly)

(String) The name that is malformed



78
79
80
# File 'lib/libpath/exceptions/malformed_name_exception.rb', line 78

def name
  @name
end