kit-contract
kit-contract

edge

  • Guides
  • Modules
    kit-contract edge

    RespondTo class
    Kit::Contract::BuiltInContracts::RespondTo
    View Source

    Ensure that the object respond_to? a specific method.


    Link to this section Summary ⚠️ Private APIs are currently hidden.

    Inheritance: InstantiableContract → Object
    Defined in: app/contracts/kit/contract/built_in_contracts/respond_to.rb#2

    Inherited from InstantiableContract

    .[](*args)

    Convenience use of the `[]` operator as an implicit `.new`.

    .named(name)

    Convenience Class method to generate a new Named contract.

    Instance methods 3

    #call(arg)

    #contract_safe?

    #setup(method_name)

    Inherited from InstantiableContract

    #initialize(state: nil, args: nil, bypass_setup: false) RUBYConstructor

    The ctor allows for creation (`args`) && duplication (`state`).

    #named(name)

    Add a meta name to the Contract.

    #meta(hash)

    Assign `meta` information on the Contract.

    #get_meta

    Meta accessor.

    #debug(args:)

    When enabled, outputs the Contract arguments when called.

    #safe_nested_call(list:, args:, contract:)

    Handle circular reference when the contract can self-reference.


    Link to this section Instance methods 3

    Link to this method

    #call(arg)

    View Source
    Link to this method

    #contract_safe?

    View Source

    Returns:

    • (Boolean)
    Link to this method

    #setup(method_name)

    View Source

    Built on 2020-06-21 by yard-0.9.25 with Kit::Doc, designed by Friedel Ziegelmayer for ExDoc.