Class: Tokite::HookEvent::BaseEvent

Inherits:
Object
  • Object
show all
Defined in:
app/models/tokite/hook_event/base_event.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hook_params) ⇒ BaseEvent

Returns a new instance of BaseEvent.



6
7
8
# File 'app/models/tokite/hook_event/base_event.rb', line 6

def initialize(hook_params)
  @hook_params = hook_params
end

Instance Attribute Details

#hook_paramsObject (readonly)

Returns the value of attribute hook_params.



4
5
6
# File 'app/models/tokite/hook_event/base_event.rb', line 4

def hook_params
  @hook_params
end

Instance Method Details

#slack_payload(rule) ⇒ Object



10
11
12
13
14
15
16
# File 'app/models/tokite/hook_event/base_event.rb', line 10

def slack_payload(rule)
  {
    channel: rule.channel,
    text: slack_text,
    attachments: slack_attachments(rule),
  }
end