Class: Skype::OS::Abstruct
- Inherits:
-
Object
- Object
- Skype::OS::Abstruct
- Defined in:
- lib/skype/os/etc.rb
Instance Method Summary collapse
- #add_hook(sym, block = Proc.new) ⇒ Object
- #attach ⇒ Object
- #attach_wait ⇒ Object
- #close ⇒ Object
- #del_hook(sym, block = nil) ⇒ Object
- #exist_hook?(sym) ⇒ Boolean
- #get_hook(sym) ⇒ Object
-
#initialize(app_name) ⇒ Abstruct
constructor
A new instance of Abstruct.
- #invoke(cmd) ⇒ Object
- #invoke_block(cmd) ⇒ Object
- #invoke_callback(cmd, callback = Proc.new) ⇒ Object
- #message_polling ⇒ Object
- #messageloop ⇒ Object
- #set_notify_selector(block = Proc.new) ⇒ Object
- #start_messageloop ⇒ Object
Constructor Details
#initialize(app_name) ⇒ Abstruct
Returns a new instance of Abstruct.
7 8 9 10 11 12 13 14 15 |
# File 'lib/skype/os/etc.rb', line 7 def initialize app_name @send_count = 0 @hook = Hash.new do |h,k| h[k] = Array.new end @attached = false @first_attached = true @raise_when_detached = false end |
Instance Method Details
#add_hook(sym, block = Proc.new) ⇒ Object
17 18 19 20 |
# File 'lib/skype/os/etc.rb', line 17 def add_hook sym, block=Proc.new @hook[sym].push block block end |
#attach ⇒ Object
81 82 |
# File 'lib/skype/os/etc.rb', line 81 def attach end |
#attach_wait ⇒ Object
84 85 |
# File 'lib/skype/os/etc.rb', line 84 def attach_wait end |
#close ⇒ Object
103 104 105 |
# File 'lib/skype/os/etc.rb', line 103 def close end |
#del_hook(sym, block = nil) ⇒ Object
22 23 24 25 26 27 28 |
# File 'lib/skype/os/etc.rb', line 22 def del_hook sym, block=nil unless block @hook[sym] = Array.new else @hook[sym].delete block end end |
#exist_hook?(sym) ⇒ Boolean
30 31 32 33 34 35 36 |
# File 'lib/skype/os/etc.rb', line 30 def exist_hook? sym if @hook[sym].length > 0 return true else return false end end |
#get_hook(sym) ⇒ Object
38 39 40 |
# File 'lib/skype/os/etc.rb', line 38 def get_hook sym @hook[sym] end |
#invoke(cmd) ⇒ Object
47 48 49 50 51 52 53 54 55 |
# File 'lib/skype/os/etc.rb', line 47 def invoke cmd begin check_response(invoke_block(cmd), cmd) rescue Skype::Error::API => e e.backtrace.shift e.backtrace.shift raise e end end |
#invoke_block(cmd) ⇒ Object
60 61 |
# File 'lib/skype/os/etc.rb', line 60 def invoke_block cmd end |
#invoke_callback(cmd, callback = Proc.new) ⇒ Object
57 58 |
# File 'lib/skype/os/etc.rb', line 57 def invoke_callback cmd, callback = Proc.new end |
#message_polling ⇒ Object
99 100 101 |
# File 'lib/skype/os/etc.rb', line 99 def end |
#messageloop ⇒ Object
95 96 97 |
# File 'lib/skype/os/etc.rb', line 95 def end |
#set_notify_selector(block = Proc.new) ⇒ Object
87 88 89 |
# File 'lib/skype/os/etc.rb', line 87 def set_notify_selector block=Proc.new end |
#start_messageloop ⇒ Object
91 92 93 |
# File 'lib/skype/os/etc.rb', line 91 def end |