module Skype
Constants
- VERSION
Public Class Methods
chats()
click to toggle source
# File lib/skype/wrappers/chat.rb, line 7 def self.chats search("recentchats"). scan(/\s(#[^\s,]+),?/). map{|i| Chat.new i[0] } end
config(conf=nil)
click to toggle source
# File lib/skype/main.rb, line 3 def self.config(conf=nil) if conf.kind_of? Hash conf.each do |k,v| @@config[k.to_sym] = v end else return @@config end end
exec(command, opts={:response_filter => true})
click to toggle source
# File lib/skype/platforms/linux.rb, line 35 def self.exec(command, opts={:response_filter => true}) res = (@@connection||=Connection.new).invoke command res = filter_response res if opts[:response_filter] res end
filter_response(response_string)
click to toggle source
# File lib/skype/filter.rb, line 10 def self.filter_response(response_string) @@filters.each do |filter, block| next unless response_string =~ filter response_string = block.call(response_string) break end response_string end
method_missing(name, *args)
click to toggle source
# File lib/skype/main.rb, line 13 def self.method_missing(name, *args) self.exec "#{name.to_s.upcase} #{args.join(' ')}" end
response_filter(pattern, &block)
click to toggle source
# File lib/skype/filter.rb, line 4 def self.response_filter(pattern, &block) raise ArgumentError, "pattern must be instance of Regexp" unless pattern.kind_of? Regexp raise ArgumentError, "block not given" unless block_given? @@filters[pattern] = block end