Module: Slatan::Affiliation::Channels

Included in:
Slatan::Affiliation
Defined in:
lib/slatan/affiliation/channels.rb

Class Method Summary collapse

Class Method Details

.getObject



7
8
9
# File 'lib/slatan/affiliation/channels.rb', line 7

def get()
  @channels
end

.get_id(name) ⇒ Object

return id of channel name

Parameters:

  • name:

    channel name



17
18
19
20
21
22
# File 'lib/slatan/affiliation/channels.rb', line 17

def get_id(name)
  @channels.each do |channel|
    return channel[:id] if channel[:name] == name
  end
  nil
end

.get_name(id) ⇒ Object

return name of channel id

Parameters:

  • id:

    channel id



26
27
28
29
30
31
# File 'lib/slatan/affiliation/channels.rb', line 26

def get_name(id)
  @channels.each do |channel|
    return channel[:name] if channel[:id] == id
  end
  nil
end

.set(channels) ⇒ Object



11
12
13
# File 'lib/slatan/affiliation/channels.rb', line 11

def set(channels)
  @channels = channels
end