Class: Nanobot::Bus::OutboundMessage
- Inherits:
-
Struct
- Object
- Struct
- Nanobot::Bus::OutboundMessage
- Defined in:
- lib/nanobot/bus/events.rb
Overview
OutboundMessage represents a message going out from the system to a channel
Instance Attribute Summary collapse
-
#channel ⇒ Object
Returns the value of attribute channel.
-
#chat_id ⇒ Object
Returns the value of attribute chat_id.
-
#content ⇒ Object
Returns the value of attribute content.
-
#media ⇒ Object
Returns the value of attribute media.
-
#metadata ⇒ Object
Returns the value of attribute metadata.
-
#reply_to ⇒ Object
Returns the value of attribute reply_to.
Instance Method Summary collapse
-
#initialize(channel:, chat_id:, content:, reply_to: nil, media: nil, metadata: nil) ⇒ OutboundMessage
constructor
A new instance of OutboundMessage.
Constructor Details
#initialize(channel:, chat_id:, content:, reply_to: nil, media: nil, metadata: nil) ⇒ OutboundMessage
Returns a new instance of OutboundMessage.
58 59 60 61 62 63 64 65 66 67 |
# File 'lib/nanobot/bus/events.rb', line 58 def initialize(channel:, chat_id:, content:, reply_to: nil, media: nil, metadata: nil) super( channel: channel, chat_id: chat_id, content: content, reply_to: reply_to, media: media || [], metadata: || {} ) end |
Instance Attribute Details
#channel ⇒ Object
Returns the value of attribute channel
43 44 45 |
# File 'lib/nanobot/bus/events.rb', line 43 def channel @channel end |
#chat_id ⇒ Object
Returns the value of attribute chat_id
43 44 45 |
# File 'lib/nanobot/bus/events.rb', line 43 def chat_id @chat_id end |
#content ⇒ Object
Returns the value of attribute content
43 44 45 |
# File 'lib/nanobot/bus/events.rb', line 43 def content @content end |
#media ⇒ Object
Returns the value of attribute media
43 44 45 |
# File 'lib/nanobot/bus/events.rb', line 43 def media @media end |
#metadata ⇒ Object
Returns the value of attribute metadata
43 44 45 |
# File 'lib/nanobot/bus/events.rb', line 43 def @metadata end |
#reply_to ⇒ Object
Returns the value of attribute reply_to
43 44 45 |
# File 'lib/nanobot/bus/events.rb', line 43 def reply_to @reply_to end |