Class: Codebot::Request
- Inherits:
-
Object
- Object
- Codebot::Request
- Defined in:
- lib/codebot/request.rb
Overview
A request which was received by the web server and can be delivered to the IRC client.
Instance Attribute Summary collapse
-
#event ⇒ Symbol
readonly
The event that triggered the webhook delivery.
-
#integration ⇒ Integration
readonly
The integration to deliver this request to.
-
#payload ⇒ Payload
readonly
The parsed request payload.
Instance Method Summary collapse
-
#each_network {|the, channels| ... } ⇒ Object
Invokes the given block for each network this request needs to be delivered to.
-
#initialize(integration, event, payload) ⇒ Request
constructor
Constructs a new request for delivery to the IRC client.
-
#to_message_for(channel) ⇒ Message
Creates a message for a given channel from this request.
Constructor Details
Instance Attribute Details
#event ⇒ Symbol (readonly)
Returns the event that triggered the webhook delivery.
14 15 16 |
# File 'lib/codebot/request.rb', line 14 def event @event end |
#integration ⇒ Integration (readonly)
Returns the integration to deliver this request to.
11 12 13 |
# File 'lib/codebot/request.rb', line 11 def integration @integration end |
#payload ⇒ Payload (readonly)
Returns the parsed request payload.
17 18 19 |
# File 'lib/codebot/request.rb', line 17 def payload @payload end |
Instance Method Details
#each_network {|the, channels| ... } ⇒ Object
Invokes the given block for each network this request needs to be delivered to.
37 38 39 40 41 |
# File 'lib/codebot/request.rb', line 37 def each_network integration.channels.group_by(&:network).each do |network, channels| yield network, channels end end |