class Xmms::Client::Async

Attributes

real[R]

Public Class Methods

new(name) click to toggle source
# File src/clients/lib/ruby/async.rb, line 21
def initialize(name)
        @real = Xmms::Client.new(name)
end

Public Instance Methods

method_missing(id, *args, &block) click to toggle source
# File src/clients/lib/ruby/async.rb, line 25
def method_missing(id, *args, &block)
        args.push(&block) if(id == 'on_disconnect')
        ret = @real.send(id, *args)
        if(block_given? && (ret.is_a?(Xmms::Result) ||
           ret.is_a?(Xmms::BroadcastResult) || ret.is_a?(Xmms::SignalResult)))
                ret.notifier(&block)
        elsif(ret.is_a?(Xmms::Client))
                self
        elsif(ret.is_a?(Xmms::Collection))
                Xmms::Collection::Async.new(ret)
        elsif(ret.is_a?(Xmms::Playlist))
                Xmms::Playlist::Async.new(ret)
        else
                ret
        end
end