Class: CollavreSlack::SlackIntegrationService
- Inherits:
-
Object
- Object
- CollavreSlack::SlackIntegrationService
- Defined in:
- app/services/collavre_slack/slack_integration_service.rb
Instance Method Summary collapse
-
#initialize(user:, slack_account:) ⇒ SlackIntegrationService
constructor
A new instance of SlackIntegrationService.
- #link_channel(creative:, channel_id:, channel_name:) ⇒ Object
- #unlink_channel(link) ⇒ Object
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 = slack_account end |
Instance Method Details
#link_channel(creative:, channel_id:, channel_name:) ⇒ Object
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: slack_account, channel_id: channel_id, channel_name: channel_name, created_by: user ) end |
#unlink_channel(link) ⇒ Object
18 19 20 |
# File 'app/services/collavre_slack/slack_integration_service.rb', line 18 def unlink_channel(link) link.destroy! end |