Class: Pwl::ErrorMessage

Inherits:
Message show all
Defined in:
lib/pwl/message.rb

Instance Attribute Summary

Attributes inherited from Message

#exit_code

Instance Method Summary collapse

Methods inherited from Message

#to_s

Constructor Details

#initialize(template, exit_code, default_replacements = {}) ⇒ ErrorMessage

Returns a new instance of ErrorMessage.



37
38
39
40
# File 'lib/pwl/message.rb', line 37

def initialize(template, exit_code, default_replacements = {})
  raise ReservedMessageCodeError.new("Exit code 0 is reserved for success messages") if 0 == exit_code
  super(template, exit_code, default_replacements)
end

Instance Method Details

#error?Boolean

Returns:

  • (Boolean)


42
43
44
# File 'lib/pwl/message.rb', line 42

def error?
  true
end