Class: Osbourne::Topic
- Inherits:
-
Object
- Object
- Osbourne::Topic
- Includes:
- Services::SNS
- Defined in:
- lib/osbourne/topic.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#prefixed_name ⇒ Object
readonly
Returns the value of attribute prefixed_name.
Instance Method Summary collapse
- #arn ⇒ Object
-
#initialize(name) ⇒ Topic
constructor
A new instance of Topic.
- #publish(message) ⇒ Object
Methods included from Services::SNS
Constructor Details
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
6 7 8 |
# File 'lib/osbourne/topic.rb', line 6 def name @name end |
#prefixed_name ⇒ Object (readonly)
Returns the value of attribute prefixed_name.
7 8 9 |
# File 'lib/osbourne/topic.rb', line 7 def prefixed_name @prefixed_name end |
Instance Method Details
#arn ⇒ Object
14 15 16 |
# File 'lib/osbourne/topic.rb', line 14 def arn @arn ||= ensure_topic end |
#publish(message) ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/osbourne/topic.rb', line 18 def publish() = parse() return if Osbourne.test_mode? Osbourne.logger.info "[Osbourne] [PUB] TOPIC: `#{prefixed_name}` MESSAGE: `#{}`" sns.publish(topic_arn: arn, message: ) end |