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
91 92 93 |
# File 'lib/cli/kit/core_ext.rb', line 91 def bug!(bug = true) singleton_class.define_method(:bug?) { bug } end |
#bug? ⇒ Boolean
: -> bool
83 |
# File 'lib/cli/kit/core_ext.rb', line 83 def bug? = (Fault::System === fault) |
#fault ⇒ Object
: -> Fault
69 |
# File 'lib/cli/kit/core_ext.rb', line 69 def fault = Fault::IMPLICITLY_SYSTEM |
#fault!(fault) ⇒ Object
: (Fault fault) -> void
72 73 74 |
# File 'lib/cli/kit/core_ext.rb', line 72 def fault!(fault) singleton_class.define_method(:fault) { fault } end |
#silent!(silent = true) ⇒ Object
: (?bool silent) -> void
96 97 98 |
# File 'lib/cli/kit/core_ext.rb', line 96 def silent!(silent = true) singleton_class.define_method(:silent?) { silent } end |
#silent? ⇒ Boolean
: -> bool
86 87 88 |
# File 'lib/cli/kit/core_ext.rb', line 86 def silent? false end |
#with_fault(fault) ⇒ Object
: (Fault fault) -> self
77 78 79 80 |
# File 'lib/cli/kit/core_ext.rb', line 77 def with_fault(fault) fault!(fault) self end |