Class: BotMob::OutboundMessage

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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_idObject (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

#textObject (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_hObject



15
16
17
# File 'lib/bot_mob/outbound_message.rb', line 15

def to_h
  { channel: channel_id, text: text }
end