Sha256: 04f908800a432938abc9bd6901c4418f9161e37d43a37155da2043a85e4ba3af

Contents?: true

Size: 653 Bytes

Versions: 4

Compression:

Stored size: 653 Bytes

Contents

# typed: strong
# frozen_string_literal: true

class Exception
  extend(T::Sig)

  # You'd think instance variables @bug and @silent would work here. They
  # don't. I'm not sure why. If you, the reader, want to take some time to
  # figure it out, go ahead and refactor to that.

  sig { returns(T::Boolean) }
  def bug?
    true
  end

  sig { returns(T::Boolean) }
  def silent?
    false
  end

  sig { params(bug: T::Boolean).void }
  def bug!(bug = true)
    singleton_class.define_method(:bug?) { bug }
  end

  sig { params(silent: T::Boolean).void }
  def silent!(silent = true)
    singleton_class.define_method(:silent?) { silent }
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
cli-kit-5.0.0 lib/cli/kit/core_ext.rb
gorails-0.1.5 vendor/deps/cli-kit/lib/cli/kit/core_ext.rb
gorails-0.1.4 vendor/deps/cli-kit/lib/cli/kit/core_ext.rb
gorails-0.1.3 vendor/deps/cli-kit/lib/cli/kit/core_ext.rb