Class: ActiveMessaging::Adapters::Test::Destination
- Inherits:
-
Object
- Object
- ActiveMessaging::Adapters::Test::Destination
- Defined in:
- lib/activemessaging/adapters/test.rb
Instance Attribute Summary collapse
-
#messages ⇒ Object
Returns the value of attribute messages.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
- #empty? ⇒ Boolean
-
#initialize(name) ⇒ Destination
constructor
A new instance of Destination.
- #receive ⇒ Object
- #send(message) ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(name) ⇒ Destination
Returns a new instance of Destination.
97 98 99 100 |
# File 'lib/activemessaging/adapters/test.rb', line 97 def initialize name @name = name @messages = [] end |
Instance Attribute Details
#messages ⇒ Object
Returns the value of attribute messages.
95 96 97 |
# File 'lib/activemessaging/adapters/test.rb', line 95 def @messages end |
#name ⇒ Object
Returns the value of attribute name.
95 96 97 |
# File 'lib/activemessaging/adapters/test.rb', line 95 def name @name end |
Instance Method Details
#empty? ⇒ Boolean
110 111 112 |
# File 'lib/activemessaging/adapters/test.rb', line 110 def empty? @messages.empty? end |
#receive ⇒ Object
102 103 104 |
# File 'lib/activemessaging/adapters/test.rb', line 102 def receive @messages.shift end |
#send(message) ⇒ Object
106 107 108 |
# File 'lib/activemessaging/adapters/test.rb', line 106 def send @messages << end |
#to_s ⇒ Object
114 115 116 |
# File 'lib/activemessaging/adapters/test.rb', line 114 def to_s "<Test::Destination name='#{name}' messages='#{@messages.inspect}'>" end |