Exception: Exception
- Defined in:
- lib/brass.rb
Instance Method Summary collapse
-
#assertion? ⇒ Boolean
Is the exception an assertion?.
-
#priority ⇒ Object
Exceptions can have priority levels.
-
#set_assertion(boolean) ⇒ Object
Set the the exception's assertion flag.
-
#set_message(msg) ⇒ Object
Set message.
-
#set_priority(level) ⇒ Object
Set priority level.
Instance Method Details
#assertion? ⇒ Boolean
Is the exception an assertion?
4 5 6 |
# File 'lib/brass.rb', line 4 def assertion? @assertion end |
#priority ⇒ Object
Exceptions can have priority levels.
Zero is a nominal error, the higher the priority the more severe the error is considered. Errors with priorities less than zero are taken be warnings, the lower the number the more trivial.
36 37 38 |
# File 'lib/brass.rb', line 36 def priority @priority ||= 0 end |
#set_assertion(boolean) ⇒ Object
Set the the exception's assertion flag.
9 10 11 |
# File 'lib/brass.rb', line 9 def set_assertion(boolean) @assertion = boolean # ? true : false end |
#set_message(msg) ⇒ Object
TODO:
Does the message have to be a string?
Set message. (not strictly needed here, but can be useful anyway).
17 18 19 |
# File 'lib/brass.rb', line 17 def (msg) @mesg = msg.to_str end |
#set_priority(level) ⇒ Object
Set priority level.
26 27 28 |
# File 'lib/brass.rb', line 26 def set_priority(level) @priority = level.to_i end |