Sha256: 21b5ec1f56db45c2700e0b4be7ace35a1503477850060b7fc551de41f805c149

Contents?: true

Size: 285 Bytes

Versions: 2

Compression:

Stored size: 285 Bytes

Contents

# frozen_string_literal: true

module BCDD::Result::Failure::Methods
  def success?(_type = nil)
    false
  end

  def failure?(type = nil)
    type.nil? || type_checker.allow_failure?([type])
  end

  def value_or
    yield(value)
  end

  private

  def name
    :failure
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
bcdd-result-0.8.0 lib/bcdd/result/failure/methods.rb
bcdd-result-0.7.0 lib/bcdd/result/failure/methods.rb