Class: Codebot::Message
- Inherits:
-
Object
- Object
- Codebot::Message
- Defined in:
- lib/codebot/message.rb
Overview
Instance Attribute Summary collapse
-
#channel ⇒ Channel
readonly
The channel to send this message to.
-
#event ⇒ Symbol
readonly
The event that caused this message to be sent.
-
#payload ⇒ Payload
readonly
The parsed request payload.
Instance Method Summary collapse
-
#format ⇒ Array<String>
Formats this message for delivery to an IRC channel.
-
#initialize(channel, event, payload, integration) ⇒ Message
constructor
Constructs a new message for delivery to an IRC channel.
Constructor Details
#initialize(channel, event, payload, integration) ⇒ Message
Constructs a new message for delivery to an IRC channel.
23 24 25 26 27 28 |
# File 'lib/codebot/message.rb', line 23 def initialize(channel, event, payload, integration) @channel = channel @event = event @payload = payload @integration = integration end |
Instance Attribute Details
#channel ⇒ Channel (readonly)
Returns the channel to send this message to.
10 11 12 |
# File 'lib/codebot/message.rb', line 10 def channel @channel end |
#event ⇒ Symbol (readonly)
Returns the event that caused this message to be sent.
13 14 15 |
# File 'lib/codebot/message.rb', line 13 def event @event end |
#payload ⇒ Payload (readonly)
Returns the parsed request payload.
16 17 18 |
# File 'lib/codebot/message.rb', line 16 def payload @payload end |
Instance Method Details
#format ⇒ Array<String>
Formats this message for delivery to an IRC channel.
33 34 35 |
# File 'lib/codebot/message.rb', line 33 def format Formatters.format(@event, @payload.to_json, @integration) end |