Class: BotMob::InboundMessage
- Inherits:
-
Object
- Object
- BotMob::InboundMessage
- Defined in:
- lib/bot_mob/inbound_message.rb
Overview
# BotMob::InboundMessage
Structured data provided to a bot
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#network ⇒ Object
readonly
Returns the value of attribute network.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(**options) ⇒ InboundMessage
constructor
A new instance of InboundMessage.
- #params ⇒ Object
Constructor Details
#initialize(**options) ⇒ InboundMessage
Returns a new instance of InboundMessage.
8 9 10 11 |
# File 'lib/bot_mob/inbound_message.rb', line 8 def initialize(**) @network = [:network] @body = [:body] end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
6 7 8 |
# File 'lib/bot_mob/inbound_message.rb', line 6 def body @body end |
#network ⇒ Object (readonly)
Returns the value of attribute network.
6 7 8 |
# File 'lib/bot_mob/inbound_message.rb', line 6 def network @network end |
Class Method Details
.prepare(message, options = {}) ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/bot_mob/inbound_message.rb', line 13 def self.prepare(, = {}) return if .is_a?(BotMob::InboundMessage) BotMob::InboundMessage.new( network: [:network] || :roaming, body: ) end |
Instance Method Details
#params ⇒ Object
22 23 24 |
# File 'lib/bot_mob/inbound_message.rb', line 22 def params @params || { body: body } end |