module BCDD::Result::Contract NONE: BCDD::Result::Contract::Evaluator def self.evaluate: ( BCDD::Result::Data, BCDD::Result::Contract::Evaluator ) -> BCDD::Result::Contract::TypeChecker ToEnsure: ^(Hash[Symbol, untyped] | Array[Symbol], Hash[Symbol, Hash[Symbol, bool]]) -> BCDD::Result::Contract::Interface def self.new: ( success: Hash[Symbol, untyped] | Array[Symbol], failure: Hash[Symbol, untyped] | Array[Symbol], config: Hash[Symbol, Hash[Symbol, bool]] ) -> BCDD::Result::Contract::Evaluator end module BCDD::Result::Contract class TypeChecker attr_reader result_type: Symbol attr_reader expectations: BCDD::Result::Contract::Evaluator def initialize: ( Symbol, expectations: BCDD::Result::Contract::Evaluator ) -> void def allow?: (Array[Symbol]) -> bool def allow_success?: (Array[Symbol]) -> bool def allow_failure?: (Array[Symbol]) -> bool private def validate: ( Array[Symbol], expected: BCDD::Result::Contract::Interface, allow_empty: bool ) -> bool end end class BCDD::Result::Contract::Error < BCDD::Result::Error class UnexpectedType < BCDD::Result::Contract::Error def self.build: (type: Symbol, allowed_types: Set[Symbol]) -> BCDD::Result::Contract::Error::UnexpectedType end class UnexpectedValue < BCDD::Result::Contract::Error def self.build: (type: Symbol, value: untyped, ?cause: Exception) -> BCDD::Result::Contract::Error::UnexpectedValue end end module BCDD::Result::Contract module Interface def ==: (BCDD::Result::Contract::Interface) -> bool def allowed_types: -> Set[Symbol] def type?: (Symbol) -> bool def type!: (Symbol) -> Symbol def type_and_value!: (BCDD::Result::Data) -> void def !=: (untyped) -> bool end end module BCDD::Result::Contract module Disabled extend Interface EMPTY_SET: Set[Symbol] end end module BCDD::Result::Contract class ForTypes include Interface def initialize: (Array[Symbol]) -> void end end module BCDD::Result::Contract class ForTypesAndValues include Interface def initialize: ( Hash[Symbol, untyped], Hash[Symbol, Hash[Symbol, bool]] ) -> void private def nil_as_valid_value_checking?: -> bool end end module BCDD::Result::Contract class Evaluator include Interface attr_reader allowed_types: Set[Symbol] attr_reader success: BCDD::Result::Contract::Interface attr_reader failure: BCDD::Result::Contract::Interface def initialize: ( BCDD::Result::Contract::Interface, BCDD::Result::Contract::Interface ) -> void private def for: (BCDD::Result::Data) -> BCDD::Result::Contract::Interface end end