Class: BotMob::OutboundMessage
- Inherits:
-
Object
- Object
- BotMob::OutboundMessage
- Defined in:
- lib/bot_mob/outbound_message.rb
Overview
# BotMob::OutboundMessage
Strucutred data for all messages leaving your bot
Direct Known Subclasses
Networks::Roaming::OutboundMessage, Networks::Slack::OutboundMessage
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#inbound ⇒ Object
readonly
Returns the value of attribute inbound.
-
#network ⇒ Object
readonly
Returns the value of attribute network.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(**options) ⇒ OutboundMessage
constructor
A new instance of OutboundMessage.
Constructor Details
#initialize(**options) ⇒ OutboundMessage
Returns a new instance of OutboundMessage.
8 9 10 11 12 |
# File 'lib/bot_mob/outbound_message.rb', line 8 def initialize(**) @network ||= [:network] @inbound = [:inbound] @body = [:body] end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
6 7 8 |
# File 'lib/bot_mob/outbound_message.rb', line 6 def body @body end |
#inbound ⇒ Object (readonly)
Returns the value of attribute inbound.
6 7 8 |
# File 'lib/bot_mob/outbound_message.rb', line 6 def inbound @inbound end |
#network ⇒ Object (readonly)
Returns the value of attribute network.
6 7 8 |
# File 'lib/bot_mob/outbound_message.rb', line 6 def network @network end |
Class Method Details
.prepare(message, options = {}) ⇒ Object
14 15 16 17 18 19 |
# File 'lib/bot_mob/outbound_message.rb', line 14 def self.prepare(, = {}) return if .is_a?(BotMob::OutboundMessage) target_network = [:inbound].network (target_network).new(.merge(body: )) end |