Class: Lita::Adapters::Slack::SlackChannel

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id, name, created, creator, raw_data) ⇒ SlackChannel

Returns a new instance of SlackChannel.



27
28
29
30
31
32
33
# File 'lib/lita/adapters/slack/slack_channel.rb', line 27

def initialize(id, name, created, creator, raw_data)
  @id       = id
  @name     = name
  @created  = created
  @creator  = creator
  @raw_data = raw_data
end

Instance Attribute Details

#createdObject (readonly)

Returns the value of attribute created.



23
24
25
# File 'lib/lita/adapters/slack/slack_channel.rb', line 23

def created
  @created
end

#creatorObject (readonly)

Returns the value of attribute creator.



24
25
26
# File 'lib/lita/adapters/slack/slack_channel.rb', line 24

def creator
  @creator
end

#idObject (readonly)

Returns the value of attribute id.



21
22
23
# File 'lib/lita/adapters/slack/slack_channel.rb', line 21

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name.



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

def name
  @name
end

#raw_dataObject (readonly)

Returns the value of attribute raw_data.



25
26
27
# File 'lib/lita/adapters/slack/slack_channel.rb', line 25

def raw_data
  @raw_data
end

Class Method Details

.from_data(channel_data) ⇒ Object



6
7
8
9
10
11
12
13
14
# File 'lib/lita/adapters/slack/slack_channel.rb', line 6

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) ⇒ Object



16
17
18
# File 'lib/lita/adapters/slack/slack_channel.rb', line 16

def from_data_array(channels_data)
  channels_data.map { |channel_data| from_data(channel_data) }
end