class Murmur::API::Channel

Public Class Methods

new(host, meta, server, channel) click to toggle source
# File lib/murmur/channel.rb, line 5
def initialize(host, meta, server, channel)
    @host = host
    @meta = meta
    @server = server
    @channel = channel
end

Public Instance Methods

description() click to toggle source
# File lib/murmur/channel.rb, line 52
def description
    @channel.description
end
description=(description) click to toggle source
# File lib/murmur/channel.rb, line 56
def description=(description)
    @channel.description = description
    update
end
id() click to toggle source
# File lib/murmur/channel.rb, line 12
def id
    @channel.id
end
name() click to toggle source
# File lib/murmur/channel.rb, line 16
def name
    @channel.name
end
name=(name) click to toggle source
# File lib/murmur/channel.rb, line 20
def name=(name)
    @channel.name = name
    update
end
parent() click to toggle source
# File lib/murmur/channel.rb, line 29
def parent
    @server.channel(@channel.parent)
end
parent=(id) click to toggle source
# File lib/murmur/channel.rb, line 33
def parent=(id)
    @channel.parent = id
    update
end
position() click to toggle source
# File lib/murmur/channel.rb, line 61
def position
    @channel.position
end
position=(id) click to toggle source
# File lib/murmur/channel.rb, line 65
def position=(id)
    @channel.position = id
    update
end
raw() click to toggle source
# File lib/murmur/channel.rb, line 70
def raw
    @channel
end
server() click to toggle source
# File lib/murmur/channel.rb, line 25
def server
    @server
end
temporary()
Alias for: temporary?
temporary=(temp) click to toggle source
# File lib/murmur/channel.rb, line 47
def temporary=(temp)
    @channel.temporary = temp
    update
end
temporary?() click to toggle source
# File lib/murmur/channel.rb, line 42
def temporary?
    @channel.temporary
end
Also aliased as: temporary

Private Instance Methods

update() click to toggle source
# File lib/murmur/channel.rb, line 76
def update
    channel_state = @server.getChannelState(id)

    ["name", "description", "temporary", "position"].each do |func|
        channel_state.send("#{func}=", send(func))
    end

    # Set 'parent' normally.
    channel_state.parent = parent.id

    @server.setChannelState(channel_state)
end