Class: CollavreSlack::SlackIntegrationService

Inherits:
Object
  • Object
show all
Defined in:
app/services/collavre_slack/slack_integration_service.rb

Instance Method Summary collapse

Constructor Details

#initialize(user:, slack_account:) ⇒ SlackIntegrationService

Returns a new instance of SlackIntegrationService.



3
4
5
6
# File 'app/services/collavre_slack/slack_integration_service.rb', line 3

def initialize(user:, slack_account:)
  @user = user
  @slack_account = 
end

Instance Method Details



8
9
10
11
12
13
14
15
16
# File 'app/services/collavre_slack/slack_integration_service.rb', line 8

def link_channel(creative:, channel_id:, channel_name:)
  SlackChannelLink.create!(
    creative: creative,
    slack_account: ,
    channel_id: channel_id,
    channel_name: channel_name,
    created_by: user
  )
end


18
19
20
# File 'app/services/collavre_slack/slack_integration_service.rb', line 18

def unlink_channel(link)
  link.destroy!
end