Module: Concurrent::Actor::Utils::AsAdHoc — Concurrent

Class List Method List File List

# Module: Concurrent::Actor::Utils::AsAdHoc

Included in:
  AdHoc
Defined in:
  lib/concurrent/actor/utils/ad_hoc.rb

## Instance Method Summary (collapse)

- - (undocumented) initialize(*args, &initializer)
- - (undocumented) on_message(message)

## Instance Method Details

### - (`undocumented`) initialize(*args, &initializer)

    6
    7
    8
    # File 'lib/concurrent/actor/utils/ad_hoc.rb', line 6

    def initialize(*args, &initializer)
      @on_message = Type! initializer.call(*args), Proc
    end

### - (`undocumented`) on_message(message)

    10
    11
    12
    # File 'lib/concurrent/actor/utils/ad_hoc.rb', line 10

    def on_message(message)
      instance_exec message, &@on_message
    end