Class: Skype::OS::MacNative
- Inherits:
-
Abstruct
- Object
- Abstruct
- Skype::OS::MacNative
- Defined in:
- lib/mac-skype/Ruby4Skype.rb
Instance Attribute Summary collapse
-
#attached ⇒ Object
Returns the value of attribute attached.
-
#debug ⇒ Object
readonly
Returns the value of attribute debug.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
- #attach ⇒ Object
- #attach_wait ⇒ Object
- #attached? ⇒ Boolean
- #close ⇒ Object
- #dettach ⇒ Object
-
#initialize(client_application_name = nil) ⇒ MacNative
constructor
A new instance of MacNative.
- #invoke_block(cmd) ⇒ Object
- #invoke_callback(cmd, cb = Proc.new) ⇒ Object
- #messageloop ⇒ Object
- #set_notify_selector(block = Proc.new) ⇒ Object
- #skype_running? ⇒ Boolean
- #start_messageloop ⇒ Object
Constructor Details
Instance Attribute Details
#attached ⇒ Object
Returns the value of attribute attached.
20 21 22 |
# File 'lib/mac-skype/Ruby4Skype.rb', line 20 def attached @attached end |
#debug ⇒ Object (readonly)
Returns the value of attribute debug.
20 21 22 |
# File 'lib/mac-skype/Ruby4Skype.rb', line 20 def debug @debug end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
20 21 22 |
# File 'lib/mac-skype/Ruby4Skype.rb', line 20 def name @name end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
20 21 22 |
# File 'lib/mac-skype/Ruby4Skype.rb', line 20 def response @response end |
Instance Method Details
#attach ⇒ Object
31 32 33 34 35 |
# File 'lib/mac-skype/Ruby4Skype.rb', line 31 def attach unless attached? @agent.connect end end |
#attach_wait ⇒ Object
37 38 39 40 41 |
# File 'lib/mac-skype/Ruby4Skype.rb', line 37 def attach_wait attach sleep 0.1 until attached? @agent.send_command('PROTOCOL 9999') end |
#attached? ⇒ Boolean
43 44 45 |
# File 'lib/mac-skype/Ruby4Skype.rb', line 43 def attached? @agent.connected? end |
#close ⇒ Object
71 72 73 |
# File 'lib/mac-skype/Ruby4Skype.rb', line 71 def close dettach if attached? end |
#dettach ⇒ Object
47 48 49 50 |
# File 'lib/mac-skype/Ruby4Skype.rb', line 47 def dettach self.attached = false @agent.disconnect end |
#invoke_block(cmd) ⇒ Object
61 62 63 64 65 |
# File 'lib/mac-skype/Ruby4Skype.rb', line 61 def invoke_block cmd p ">#{cmd}" if @debug @agent.send_command(cmd) end |
#invoke_callback(cmd, cb = Proc.new) ⇒ Object
56 57 58 59 |
# File 'lib/mac-skype/Ruby4Skype.rb', line 56 def invoke_callback cmd, cb = Proc.new res = invoke_block cmd cb.call res end |
#messageloop ⇒ Object
27 28 29 |
# File 'lib/mac-skype/Ruby4Skype.rb', line 27 def @agent.run_forever end |
#set_notify_selector(block = Proc.new) ⇒ Object
67 68 69 |
# File 'lib/mac-skype/Ruby4Skype.rb', line 67 def set_notify_selector(block = Proc.new) @agent.(&block) end |
#skype_running? ⇒ Boolean
52 53 54 |
# File 'lib/mac-skype/Ruby4Skype.rb', line 52 def skype_running? @agent.running? end |
#start_messageloop ⇒ Object
23 24 25 |
# File 'lib/mac-skype/Ruby4Skype.rb', line 23 def raise 'not impremented yet. use messageloop().' end |