Class: SkypeAPI::OS::Abstruct

Inherits:
Object
  • Object
show all
Defined in:
lib/skypeapi/os/etc.rb

Direct Known Subclasses

Linux, Windows

Instance Method Summary collapse

Constructor Details

#initializeAbstruct

Returns a new instance of Abstruct.



7
8
9
10
11
12
13
14
15
# File 'lib/skypeapi/os/etc.rb', line 7

def initialize
  @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/skypeapi/os/etc.rb', line 17

def add_hook sym, block=Proc.new
  @hook[sym].push block
  block
end

#attach(name = nil) ⇒ Object



72
73
# File 'lib/skypeapi/os/etc.rb', line 72

def attach name = nil
end

#attach_wait(name = nil) ⇒ Object



75
76
# File 'lib/skypeapi/os/etc.rb', line 75

def attach_wait name = nil
end

#closeObject



78
79
# File 'lib/skypeapi/os/etc.rb', line 78

def close
end

#del_hook(sym, block = nil) ⇒ Object



22
23
24
25
26
27
28
# File 'lib/skypeapi/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

Returns:

  • (Boolean)


30
31
32
33
34
35
36
# File 'lib/skypeapi/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/skypeapi/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/skypeapi/os/etc.rb', line 47

def invoke cmd
  begin
    check_response(invoke_block(cmd), cmd)
  rescue SkypeAPI::Error::API => e
    e.backtrace.shift
    e.backtrace.shift
    raise e
  end
end

#invoke_block(cmd) ⇒ Object



60
61
# File 'lib/skypeapi/os/etc.rb', line 60

def invoke_block cmd
end

#invoke_callback(cmd, callback = Proc.new) ⇒ Object



57
58
# File 'lib/skypeapi/os/etc.rb', line 57

def invoke_callback cmd, callback = Proc.new
end