Class: Minitest::Distributed::EnqueuedRunnable::Result::Commit

Inherits:
Object
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/minitest/distributed/enqueued_runnable.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(&block) ⇒ Commit

Returns a new instance of Commit.



58
59
60
# File 'lib/minitest/distributed/enqueued_runnable.rb', line 58

def initialize(&block)
  @block = block
end

Class Method Details

.failureObject



78
79
80
# File 'lib/minitest/distributed/enqueued_runnable.rb', line 78

def self.failure
  @failure ||= T.let(new { false }, T.nilable(Commit))
end

.successObject



73
74
75
# File 'lib/minitest/distributed/enqueued_runnable.rb', line 73

def self.success
  @success ||= T.let(new { true }, T.nilable(Commit))
end

Instance Method Details

#failure?Boolean

Returns:

  • (Boolean)


68
69
70
# File 'lib/minitest/distributed/enqueued_runnable.rb', line 68

def failure?
  !success?
end

#success?Boolean

Returns:

  • (Boolean)


63
64
65
# File 'lib/minitest/distributed/enqueued_runnable.rb', line 63

def success?
  @success ||= T.let(@block.call, T.nilable(T::Boolean))
end