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.
174 175 176 177 178 179 |
# File 'lib/fare/test_mode.rb', line 174 def initialize(name, ) @name = name @arn = name @queues = [] = end |
Instance Attribute Details
#arn ⇒ Object (readonly)
Returns the value of attribute arn.
172 173 174 |
# File 'lib/fare/test_mode.rb', line 172 def arn @arn end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
172 173 174 |
# File 'lib/fare/test_mode.rb', line 172 def name @name end |
Instance Method Details
#owner ⇒ Object
186 187 188 |
# File 'lib/fare/test_mode.rb', line 186 def owner :owner end |
#publish(message) ⇒ Object
190 191 192 193 194 195 |
# File 'lib/fare/test_mode.rb', line 190 def publish() .register_publish() @queues.each do |arn| Fare.queue_adapter.fetch_by_arn(arn).publish() end end |
#subscribe(queue_arn) ⇒ Object
181 182 183 184 |
# File 'lib/fare/test_mode.rb', line 181 def subscribe(queue_arn) @queues << queue_arn Subscription.new end |