module BCDD class Result VERSION: String end end class BCDD::Result private attr_accessor unknown: bool attr_reader _type: BCDD::Result::Type attr_reader value: untyped attr_reader subject: untyped def initialize: (type: Symbol, value: untyped, ?subject: untyped) -> void def type: -> Symbol def success?: (?Symbol type) -> bool def failure?: (?Symbol type) -> bool def value_or: { () -> untyped } -> untyped def on: (*Symbol) { (untyped, Symbol) -> void } -> BCDD::Result def on_success: (*Symbol) { (untyped, Symbol) -> void } -> BCDD::Result def on_failure: (*Symbol) { (untyped, Symbol) -> void } -> BCDD::Result def on_unknown: () { (untyped, Symbol) -> void } -> BCDD::Result def and_then: (?Symbol method_name) { (untyped) -> untyped } -> BCDD::Result def handle: { (BCDD::Result::Handler) -> void } -> untyped def data: -> BCDD::Result::Data def ==: (untyped) -> bool def hash: -> Integer def inspect: -> String def deconstruct: -> [Symbol, [Symbol, untyped]] def deconstruct_keys: (Array[Symbol]) -> Hash[Symbol, Hash[Symbol, untyped]] alias eql? == alias on_type on private def name: -> Symbol def known: (Proc) -> untyped def call_subject_method: (Symbol) -> BCDD::Result def ensure_result_object: (untyped, origin: Symbol) -> BCDD::Result end class BCDD::Result class Failure < BCDD::Result end def self.Success: (Symbol type, ?untyped value) -> BCDD::Result::Success end class BCDD::Result class Success < BCDD::Result end def self.Failure: (Symbol type, ?untyped value) -> BCDD::Result::Failure end class BCDD::Result module Mixin def Success: (Symbol type, ?untyped value) -> BCDD::Result::Success def Failure: (Symbol type, ?untyped value) -> BCDD::Result::Failure end end class BCDD::Result class Handler UNDEFINED: Object def initialize: (BCDD::Result) -> void def []: (*Symbol) { (untyped, Symbol) -> void } -> untyped def failure: (*Symbol) { (untyped, Symbol) -> void } -> untyped def success: (*Symbol) { (untyped, Symbol) -> void } -> untyped def unknown: () { (untyped, Symbol) -> void } -> untyped alias type [] private attr_reader _type: BCDD::Result::Type attr_reader result: BCDD::Result def outcome?: -> bool def outcome=: (Proc) -> void def outcome: -> untyped end end class BCDD::Result class Type attr_reader to_sym: Symbol def initialize: (Symbol) -> void def in?: (Array[Symbol], allow_empty: bool) -> bool end end class BCDD::Result class Data attr_reader name: Symbol attr_reader type: Symbol attr_reader value: untyped attr_reader to_h: Hash[Symbol, untyped] attr_reader to_a: [Symbol, Symbol, untyped] def initialize: (BCDD::Result) -> void def inspect: -> String alias to_ary to_a alias to_hash to_h end end class BCDD::Result class Error < ::StandardError def self.build: (**untyped) -> BCDD::Result::Error class NotImplemented < BCDD::Result::Error end class MissingTypeArgument < BCDD::Result::Error end class UnexpectedOutcome < BCDD::Result::Error def self.build: (outcome: untyped, origin: Symbol) -> BCDD::Result::Error::UnexpectedOutcome end class WrongResultSubject < BCDD::Result::Error def self.build: (given_result: BCDD::Result, expected_subject: untyped) -> BCDD::Result::Error::WrongResultSubject end class WrongSubjectMethodArity < BCDD::Result::Error def self.build: (subject: untyped, method: ::Method) -> BCDD::Result::Error::WrongSubjectMethodArity end end end