Exception: Exception
- Defined in:
- lib/cli/kit/core_ext.rb
Overview
typed: strict frozen_string_literal: true
Direct Known Subclasses
Defined Under Namespace
Classes: Fault
Instance Method Summary collapse
-
#bug!(bug = true) ⇒ Object
: (?bool bug) -> void.
-
#bug? ⇒ Boolean
: -> bool.
-
#fault ⇒ Object
: -> Fault.
-
#fault!(fault) ⇒ Object
: (Fault fault) -> void.
-
#silent!(silent = true) ⇒ Object
: (?bool silent) -> void.
-
#silent? ⇒ Boolean
: -> bool.
-
#with_fault(fault) ⇒ Object
: (Fault fault) -> self.
Instance Method Details
#bug!(bug = true) ⇒ Object
: (?bool bug) -> void
92 93 94 |
# File 'lib/cli/kit/core_ext.rb', line 92 def bug!(bug = true) singleton_class.define_method(:bug?) { bug } end |
#bug? ⇒ Boolean
: -> bool
84 |
# File 'lib/cli/kit/core_ext.rb', line 84 def bug? = (Fault::System === fault) |
#fault ⇒ Object
: -> Fault
70 |
# File 'lib/cli/kit/core_ext.rb', line 70 def fault = Fault::IMPLICITLY_SYSTEM |
#fault!(fault) ⇒ Object
: (Fault fault) -> void
73 74 75 |
# File 'lib/cli/kit/core_ext.rb', line 73 def fault!(fault) singleton_class.define_method(:fault) { fault } end |
#silent!(silent = true) ⇒ Object
: (?bool silent) -> void
97 98 99 |
# File 'lib/cli/kit/core_ext.rb', line 97 def silent!(silent = true) singleton_class.define_method(:silent?) { silent } end |
#silent? ⇒ Boolean
: -> bool
87 88 89 |
# File 'lib/cli/kit/core_ext.rb', line 87 def silent? false end |
#with_fault(fault) ⇒ Object
: (Fault fault) -> self
78 79 80 81 |
# File 'lib/cli/kit/core_ext.rb', line 78 def with_fault(fault) fault!(fault) self end |