Module: Slatan::Affiliation::Channels
- Included in:
- Slatan::Affiliation
- Defined in:
- lib/slatan/affiliation/channels.rb
Class Method Summary collapse
- .get ⇒ Object
-
.get_id(name) ⇒ Object
return id of channel name.
-
.get_name(id) ⇒ Object
return name of channel id.
- .set(channels) ⇒ Object
Class Method Details
.get ⇒ Object
7 8 9 |
# File 'lib/slatan/affiliation/channels.rb', line 7 def get() @channels end |
.get_id(name) ⇒ Object
return id of 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
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 |