Module: Skype::AbstractObject::Notify

Included in:
Skype, Skype::AbstractObject, Skype::AbstractObject
Defined in:
lib/skype/object.rb

Instance Method Summary collapse

Instance Method Details

#delNotify(property = nil, value = nil) ⇒ Object Also known as: del_notify



15
16
17
# File 'lib/skype/object.rb', line 15

def delNotify property=nil,value=nil
  @notify[property].delete value
end

#notified(instance, property, value) ⇒ Object



24
25
26
27
28
29
30
31
32
33
# File 'lib/skype/object.rb', line 24

def notified instance, property,value
  if @notify[nil]
    @notify[nil][nil].call instance, property, value if @notify[nil][nil]
    @notify[nil][value].call instance, property if @notify[nil][value]
  end
  if @notify[property]
    @notify[property][nil].call instance, value if @notify[property][nil]
    @notify[property][value].call instance if @notify[property][value]
  end
end

#notifyObject



20
21
22
# File 'lib/skype/object.rb', line 20

def notify
  @notify
end

#setNotify(property = nil, value = nil, block = Proc.new) ⇒ Object Also known as: set_notify



7
8
9
10
11
12
# File 'lib/skype/object.rb', line 7

def setNotify property=nil,value=nil, block=Proc.new
  property = property.to_s.downcase.to_sym if property
  value = value.to_s.upcase if value.class == Symbol
  @notify[property] = Hash.new unless @notify[property]
  @notify[property][value] = block
end