Class: Actor::Messaging::Send::Substitute
- Inherits:
-
Object
- Object
- Actor::Messaging::Send::Substitute
- Defined in:
- lib/actor/messaging/send/substitute.rb
Defined Under Namespace
Classes: Record
Instance Attribute Summary collapse
-
#records ⇒ Object
readonly
Returns the value of attribute records.
Instance Method Summary collapse
- #call(message, address, wait: nil) ⇒ Object
-
#initialize ⇒ Substitute
constructor
A new instance of Substitute.
- #sent?(message = nil, address: nil, wait: nil) ⇒ Boolean
Constructor Details
#initialize ⇒ Substitute
Returns a new instance of Substitute.
7 8 9 |
# File 'lib/actor/messaging/send/substitute.rb', line 7 def initialize @records = [] end |
Instance Attribute Details
#records ⇒ Object (readonly)
Returns the value of attribute records.
5 6 7 |
# File 'lib/actor/messaging/send/substitute.rb', line 5 def records @records end |
Instance Method Details
#call(message, address, wait: nil) ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/actor/messaging/send/substitute.rb', line 11 def call , address, wait: nil wait = false if wait.nil? record = Record.new , address, wait records << record end |
#sent?(message = nil, address: nil, wait: nil) ⇒ Boolean
19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/actor/messaging/send/substitute.rb', line 19 def sent? =nil, address: nil, wait: nil records.each do |record| next unless .nil? or record. next unless address.nil? or record.address == address next unless wait.nil? or record.wait == wait return true end false end |