Class: Actor::TestFixtures::SampleActorStatus
- Inherits:
-
Object
- Object
- Actor::TestFixtures::SampleActorStatus
- Includes:
- TestBench::Fixture
- Defined in:
- lib/actor/test_fixtures/sample_actor_status.rb
Instance Attribute Summary collapse
-
#reader ⇒ Object
readonly
Returns the value of attribute reader.
-
#reply_address ⇒ Object
readonly
Returns the value of attribute reply_address.
-
#writer ⇒ Object
readonly
Returns the value of attribute writer.
Class Method Summary collapse
Instance Method Summary collapse
- #call(test_prose, &block) ⇒ Object
-
#initialize(writer, reply_address, reader) ⇒ SampleActorStatus
constructor
A new instance of SampleActorStatus.
- #record_status_message ⇒ Object
Constructor Details
#initialize(writer, reply_address, reader) ⇒ SampleActorStatus
Returns a new instance of SampleActorStatus.
10 11 12 13 14 |
# File 'lib/actor/test_fixtures/sample_actor_status.rb', line 10 def initialize writer, reply_address, reader @reader = reader @reply_address = reply_address @writer = writer end |
Instance Attribute Details
#reader ⇒ Object (readonly)
Returns the value of attribute reader.
6 7 8 |
# File 'lib/actor/test_fixtures/sample_actor_status.rb', line 6 def reader @reader end |
#reply_address ⇒ Object (readonly)
Returns the value of attribute reply_address.
7 8 9 |
# File 'lib/actor/test_fixtures/sample_actor_status.rb', line 7 def reply_address @reply_address end |
#writer ⇒ Object (readonly)
Returns the value of attribute writer.
8 9 10 |
# File 'lib/actor/test_fixtures/sample_actor_status.rb', line 8 def writer @writer end |
Class Method Details
.call(prose, address:, test:) ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/actor/test_fixtures/sample_actor_status.rb', line 16 def self.call prose, address:, test: reply_address = Messaging::Address.build reader = Messaging::Reader.build reply_address writer = Messaging::Writer.build address instance = new writer, reply_address, reader instance.(prose, &test) end |
Instance Method Details
#call(test_prose, &block) ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/actor/test_fixtures/sample_actor_status.rb', line 26 def call test_prose, &block writer.() status_0 = reader.(wait: true) writer.() status_1 = reader.(wait: true) test test_prose do block.(status_1, status_0) end end |
#record_status_message ⇒ Object
40 41 42 |
# File 'lib/actor/test_fixtures/sample_actor_status.rb', line 40 def Message::RecordStatus.new reply_address end |