class Lita::Adapters::Slack::SlackChannel

A struct representing a Slack channel, group, or IM. @api public

Attributes

created[R]

@return [String] A timestamp indicating when the channel was created.

creator[R]

@return [String] The unique ID of the user who created the channel.

id[R]

@return [String] The channel's unique ID.

name[R]

@return [String] The human-readable name for the channel.

raw_data[R]

@return [Hash] The raw channel data received from Slack, including many more fields.

Public Class Methods

from_data(channel_data) click to toggle source

@api private

# File lib/lita/adapters/slack/slack_channel.rb, line 9
def from_data(channel_data)
  new(
      channel_data['id'],
      channel_data['name'],
      channel_data['created'],
      channel_data['creator'],
      channel_data
  )
end
from_data_array(channels_data) click to toggle source

@api private

# File lib/lita/adapters/slack/slack_channel.rb, line 20
def from_data_array(channels_data)
  channels_data.map { |channel_data| from_data(channel_data) }
end
new(id, name, created, creator, raw_data) click to toggle source
# File lib/lita/adapters/slack/slack_channel.rb, line 36
def initialize(id, name, created, creator, raw_data)
  @id       = id
  @name     = name
  @created  = created
  @creator  = creator
  @raw_data = raw_data
end