Class: Skype::Event
Constant Summary
collapse
- OBJECT_NAME =
"EVENT"
Instance Attribute Summary
#property2callback, #property2symbol
Class Method Summary
collapse
Instance Method Summary
collapse
inherited, #initialize, new, #to_s
#delNotify, #notify
#def_parser, #notice
#invoke_alter, #invoke_echo, #invoke_get, #invoke_one, #invoke_set
Class Method Details
.create(id, caption, hint, block = Proc.new) ⇒ Object
6
7
8
9
10
11
12
|
# File 'lib/skype/event.rb', line 6
def create id, caption, hint, block=Proc.new
res = Skype.invoke "CREATE EVENT #{id} CAPTION #{caption} HINT #{hint}"
res == "EVENT #{id} CREATED"
instance = new id
instance.setNotify block if block
instance
end
|
.delete(id) ⇒ Object
29
30
31
|
# File 'lib/skype/event.rb', line 29
def delete id
new(id).delete
end
|
.notified(msg) ⇒ Object
19
20
21
22
23
24
25
26
27
|
# File 'lib/skype/event.rb', line 19
def notified msg
if msg =~ /^([^ ]+) CLICKED$/m
id = $1
instance = new $1
@notify[nil].call instance if @notify[nil]
@notify[id].call instance if @notify[id]
@@instance[self][id].notified if @@instance[self][id]
end
end
|
.set_notify(id = nil, block = Proc.new) ⇒ Object
14
15
16
|
# File 'lib/skype/event.rb', line 14
def set_notify id=nil, block=Proc.new
@notify[id] = block
end
|
.setNotify ⇒ Object
17
18
19
|
# File 'lib/skype/event.rb', line 17
def set_notify id=nil, block=Proc.new
@notify[id] = block
end
|
Instance Method Details
#delete ⇒ Object
44
45
46
47
|
# File 'lib/skype/event.rb', line 44
def delete
res = invoke "DELETE EVENT #{@id}"
res == "DELETE EVENT #{@id}"
end
|
#notified ⇒ Object
35
36
37
|
# File 'lib/skype/event.rb', line 35
def notified
@notify.call self if @notify
end
|
#set_notify(block = Proc.new) ⇒ Object
Also known as:
setNotify
39
40
41
|
# File 'lib/skype/event.rb', line 39
def set_notify block=Proc.new
@notify = block
end
|