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
180 181 182 183 184 185 |
# File 'lib/fare/test_mode.rb', line 180 def initialize(name, ) @name = name @arn = name @queues = [] @message_list = end |
Instance Attribute Details
#arn ⇒ Object (readonly)
Returns the value of attribute arn.
178 179 180 |
# File 'lib/fare/test_mode.rb', line 178 def arn @arn end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
178 179 180 |
# File 'lib/fare/test_mode.rb', line 178 def name @name end |
Instance Method Details
#owner ⇒ Object
192 193 194 |
# File 'lib/fare/test_mode.rb', line 192 def owner :owner end |
#publish(message) ⇒ Object
196 197 198 199 200 201 |
# File 'lib/fare/test_mode.rb', line 196 def publish() @message_list.register_publish() @queues.each do |arn| Fare.queue_adapter.fetch_by_arn(arn).publish() end end |
#subscribe(queue_arn) ⇒ Object
187 188 189 190 |
# File 'lib/fare/test_mode.rb', line 187 def subscribe(queue_arn) @queues << queue_arn Subscription.new end |