Class: Channel

Inherits:
Object
  • Object
show all
Defined in:
src/models/channel.rb

Overview

Describes and provides operations on a particular Slack channel

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#idString (readonly)

Returns the channel id

Returns:

  • (String)

    the channel id



4
5
6
# File 'src/models/channel.rb', line 4

def id
  @id
end

Instance Method Details

#==(other) ⇒ Boolean Also known as: eql?

Compare channels by ID

Parameters:

  • other (Channel)

    The other channel to compare to.

Returns:

  • (Boolean)

    The comparison result.



16
17
18
# File 'src/models/channel.rb', line 16

def ==(other)
  @id == other.id
end

#direct_message?Boolean

Check if the channel is a direct message one

Returns:

  • (Boolean)


30
31
32
# File 'src/models/channel.rb', line 30

def direct_message?
  @id[0] == 'D'
end