Class: Slack::Channel

Inherits:
Object
  • Object
show all
Defined in:
lib/edi/slack/channel.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, name:) ⇒ Channel

Returns a new instance of Channel.



4
5
6
7
# File 'lib/edi/slack/channel.rb', line 4

def initialize(id:, name:)
  @id = id
  @name = name
end

Instance Attribute Details

#idObject

Returns the value of attribute id.



3
4
5
# File 'lib/edi/slack/channel.rb', line 3

def id
  @id
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/edi/slack/channel.rb', line 3

def name
  @name
end

Class Method Details

.find_by_id(id) ⇒ Object



13
14
15
# File 'lib/edi/slack/channel.rb', line 13

def self.find_by_id(id)
  EDI.channels.find { |c| c.id == id }
end

.find_by_name(name) ⇒ Object



9
10
11
# File 'lib/edi/slack/channel.rb', line 9

def self.find_by_name(name)
  EDI.channels.find { |c| c.name == name }
end