Exception: TaskList::Exceptions::InvalidTaskTypeError

Inherits:
NameError
  • Object
show all
Defined in:
lib/task-list/exceptions/invalid_task_type.rb

Instance Method Summary collapse

Constructor Details

#initialize(type: "", message: "") ⇒ InvalidTaskTypeError

Returns a new instance of InvalidTaskTypeError.



4
5
6
7
8
9
10
11
12
13
14
# File 'lib/task-list/exceptions/invalid_task_type.rb', line 4

def initialize(type: "", message: "")
  if message.empty?
    message = "tl: Invalid task type"

    unless type.empty?
      message << ": #{type}"
    end
  end

  super message
end