Class: Announce::Message
- Inherits:
-
Object
- Object
- Announce::Message
- Defined in:
- lib/announce/message.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
- #app ⇒ Object
-
#initialize(options = {}) ⇒ Message
constructor
A new instance of Message.
- #to_json ⇒ Object
- #to_message ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Message
Returns a new instance of Message.
8 9 10 11 12 13 14 |
# File 'lib/announce/message.rb', line 8 def initialize(={}) @options = { 'message_id' => SecureRandom.uuid, 'app' => app, 'sent_at' => Time.now.utc }.merge().stringify_keys end |
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options.
6 7 8 |
# File 'lib/announce/message.rb', line 6 def @options end |
Instance Method Details
#app ⇒ Object
16 17 18 |
# File 'lib/announce/message.rb', line 16 def app Announce.[:app_name] end |
#to_json ⇒ Object
24 25 26 |
# File 'lib/announce/message.rb', line 24 def to_json .to_json end |
#to_message ⇒ Object
20 21 22 |
# File 'lib/announce/message.rb', line 20 def .stringify_keys end |