lib/bcdd/result/failure.rb in bcdd-result-0.6.0 vs lib/bcdd/result/failure.rb in bcdd-result-0.7.0

- old
+ new

@@ -1,25 +1,11 @@ # frozen_string_literal: true class BCDD::Result class Failure < self - def success?(_type = nil) - false - end + require_relative 'failure/methods' - def failure?(type = nil) - type.nil? || type_checker.allow_failure?([type]) - end - - def value_or - yield - end - - private - - def name - :failure - end + include Methods end def self.Failure(type, value = nil) Failure.new(type: type, value: value) end