Class: Lita::Adapters::Slack::SlackChannel
- Inherits:
-
Object
- Object
- Lita::Adapters::Slack::SlackChannel
- Defined in:
- lib/lita/adapters/slack/slack_channel.rb
Instance Attribute Summary collapse
-
#created ⇒ Object
readonly
Returns the value of attribute created.
-
#creator ⇒ Object
readonly
Returns the value of attribute creator.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#raw_data ⇒ Object
readonly
Returns the value of attribute raw_data.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(id, name, created, creator, raw_data) ⇒ SlackChannel
constructor
A new instance of SlackChannel.
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
#created ⇒ Object (readonly)
Returns the value of attribute created.
23 24 25 |
# File 'lib/lita/adapters/slack/slack_channel.rb', line 23 def created @created end |
#creator ⇒ Object (readonly)
Returns the value of attribute creator.
24 25 26 |
# File 'lib/lita/adapters/slack/slack_channel.rb', line 24 def creator @creator end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
21 22 23 |
# File 'lib/lita/adapters/slack/slack_channel.rb', line 21 def id @id end |
#name ⇒ Object (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_data ⇒ Object (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 |