Class: BotMob::OutboundMessage
- Inherits:
-
Object
- Object
- BotMob::OutboundMessage
- Defined in:
- lib/bot_mob/outbound_message.rb
Overview
## BotMob::Outbound Message
The OutboundMessage class provides a convenient way to consistently allow your bot to respond to a given network
Instance Attribute Summary collapse
-
#channel_id ⇒ Object
readonly
Returns the value of attribute channel_id.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Instance Method Summary collapse
-
#initialize(data) ⇒ OutboundMessage
constructor
A new instance of OutboundMessage.
- #to_h ⇒ Object
Constructor Details
#initialize(data) ⇒ OutboundMessage
Returns a new instance of OutboundMessage.
10 11 12 13 |
# File 'lib/bot_mob/outbound_message.rb', line 10 def initialize(data) @text = data[:text] @channel_id = data[:channel_id] end |
Instance Attribute Details
#channel_id ⇒ Object (readonly)
Returns the value of attribute channel_id.
8 9 10 |
# File 'lib/bot_mob/outbound_message.rb', line 8 def channel_id @channel_id end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
8 9 10 |
# File 'lib/bot_mob/outbound_message.rb', line 8 def text @text end |
Instance Method Details
#to_h ⇒ Object
15 16 17 |
# File 'lib/bot_mob/outbound_message.rb', line 15 def to_h { channel: channel_id, text: text } end |