Class: Lita::Adapters::Slack::ChatService

Inherits:
Object
  • Object
show all
Defined in:
lib/lita/adapters/slack/chat_service.rb

Overview

Slack-specific features made available to Lita::Robot.

Since:

  • 1.6.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ ChatService

Returns a new instance of ChatService.

Parameters:

  • config (Lita::Configuration)

    The adapter’s configuration data.

Since:

  • 1.6.0



13
14
15
# File 'lib/lita/adapters/slack/chat_service.rb', line 13

def initialize(config)
  self.api = API.new(config)
end

Instance Attribute Details

#apiObject

Since:

  • 1.6.0



10
11
12
# File 'lib/lita/adapters/slack/chat_service.rb', line 10

def api
  @api
end

Instance Method Details

#send_attachments(target, attachments) ⇒ void Also known as: send_attachment

This method returns an undefined value.

Parameters:

  • target (Lita::Room, Lita::User)

    A room or user object indicating where the attachment should be sent.

  • attachments (Attachment, Array<Attachment>)

    An Attachment or array of Attachments to send.

Since:

  • 1.6.0



22
23
24
# File 'lib/lita/adapters/slack/chat_service.rb', line 22

def send_attachments(target, attachments)
  api.send_attachments(target, Array(attachments))
end