Class: Fare::TestMode::TopicAdapter::Topic
- Inherits:
-
Object
- Object
- Fare::TestMode::TopicAdapter::Topic
- Defined in:
- lib/fare/test_mode.rb
Defined Under Namespace
Classes: Subscription
Instance Attribute Summary collapse
-
#arn ⇒ Object
readonly
Returns the value of attribute arn.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name, message_list) ⇒ Topic
constructor
A new instance of Topic.
- #owner ⇒ Object
- #publish(message) ⇒ Object
- #subscribe(queue_arn) ⇒ Object
Constructor Details
#initialize(name, message_list) ⇒ Topic
Returns a new instance of Topic.
185 186 187 188 189 190 |
# File 'lib/fare/test_mode.rb', line 185 def initialize(name, ) @name = name @arn = name @queues = [] @message_list = end |
Instance Attribute Details
#arn ⇒ Object (readonly)
Returns the value of attribute arn.
183 184 185 |
# File 'lib/fare/test_mode.rb', line 183 def arn @arn end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
183 184 185 |
# File 'lib/fare/test_mode.rb', line 183 def name @name end |
Instance Method Details
#owner ⇒ Object
197 198 199 |
# File 'lib/fare/test_mode.rb', line 197 def owner :owner end |
#publish(message) ⇒ Object
201 202 203 204 205 206 |
# File 'lib/fare/test_mode.rb', line 201 def publish() @message_list.register_publish() @queues.each do |arn| Fare.queue_adapter.fetch_by_arn(arn).publish() end end |
#subscribe(queue_arn) ⇒ Object
192 193 194 195 |
# File 'lib/fare/test_mode.rb', line 192 def subscribe(queue_arn) @queues << queue_arn Subscription.new end |