class Actor::Messaging::Send::Substitute

Constants

Record

Attributes

records[R]

Public Class Methods

new() click to toggle source
# File lib/actor/messaging/send/substitute.rb, line 7
def initialize
  @records = []
end

Public Instance Methods

call(message, address, wait: nil) click to toggle source
# File lib/actor/messaging/send/substitute.rb, line 11
def call message, address, wait: nil
  wait = false if wait.nil?

  record = Record.new message, address, wait

  records << record
end
sent?(message=nil, address: nil, wait: nil) click to toggle source
# File lib/actor/messaging/send/substitute.rb, line 19
def sent? message=nil, address: nil, wait: nil
  records.each do |record|
    next unless message.nil? or record.message? message
    next unless address.nil? or record.address == address
    next unless wait.nil? or record.wait == wait

    return true
  end

  false
end