2025-08-19 13:03:08 +01:00
|
|
|
# typed: strict
|
2025-02-04 16:27:39 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class PourBottleCheck
|
|
|
|
include OnSystem::MacOSAndLinux
|
|
|
|
|
2025-08-19 13:03:08 +01:00
|
|
|
sig { params(formula: T.class_of(Formula)).void }
|
2025-02-04 16:27:39 +00:00
|
|
|
def initialize(formula)
|
|
|
|
@formula = formula
|
|
|
|
end
|
|
|
|
|
2025-08-19 13:03:08 +01:00
|
|
|
sig { params(reason: String).void }
|
2025-02-04 16:27:39 +00:00
|
|
|
def reason(reason)
|
|
|
|
@formula.pour_bottle_check_unsatisfied_reason = reason
|
|
|
|
end
|
|
|
|
|
2025-08-19 13:03:08 +01:00
|
|
|
sig { params(block: T.proc.void).void }
|
2025-02-04 16:27:39 +00:00
|
|
|
def satisfy(&block)
|
|
|
|
@formula.send(:define_method, :pour_bottle?, &block)
|
|
|
|
end
|
|
|
|
end
|