Class: TeamSpeak3::ChannelCollection
- Inherits:
-
Array
- Object
- Array
- TeamSpeak3::ChannelCollection
- Defined in:
- lib/channel_collection.rb
Instance Method Summary collapse
- #create(name, opts = {}) ⇒ Object
- #find(id) ⇒ Object
-
#initialize(virtual_server) ⇒ ChannelCollection
constructor
A new instance of ChannelCollection.
Constructor Details
#initialize(virtual_server) ⇒ ChannelCollection
Returns a new instance of ChannelCollection.
3 4 5 |
# File 'lib/channel_collection.rb', line 3 def initialize(virtual_server) @virtual_server = virtual_server end |
Instance Method Details
#create(name, opts = {}) ⇒ Object
7 8 9 |
# File 'lib/channel_collection.rb', line 7 def create(name, opts = {}) Channel.create(@virtual_server, name, opts) end |
#find(id) ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/channel_collection.rb', line 11 def find(id) self.each do |channel| return channel if channel.id == id.to_i end nil end |