Class: Skype::Application

Inherits:
AbstractObject show all
Defined in:
lib/skype/application.rb

Defined Under Namespace

Classes: Stream

Constant Summary collapse

OBJECT_NAME =
"APPLICATION"

Instance Attribute Summary

Attributes included from Skype::AbstractObject::Get

#property2callback, #property2symbol

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from AbstractObject

inherited, #initialize, new, notified, #to_s

Methods included from Skype::AbstractObject::Notify

#delNotify, #notified, #notify, #setNotify

Methods included from Skype::AbstractObject::Get

#def_parser, #notice

Methods included from Skype::AbstractObject::Invokers

#invoke_alter, #invoke_echo, #invoke_get, #invoke_one, #invoke_set

Constructor Details

This class inherits a constructor from Skype::AbstractObject

Class Method Details

.create(appName) ⇒ Object



72
73
74
75
76
# File 'lib/skype/application.rb', line 72

def self.create appName
  app = new appName
  app.create
  app
end

Instance Method Details

#connect(user) ⇒ Object



82
83
84
# File 'lib/skype/application.rb', line 82

def connect user
  invoke_echo "ALTER APPLICATION #{@id} CONNECT #{user}"
end

#createObject



78
79
80
# File 'lib/skype/application.rb', line 78

def create
  invoke_echo "CREATE APPLICATION #{@id}"
end

#datagram(stream, msg) ⇒ Object



90
91
92
# File 'lib/skype/application.rb', line 90

def datagram stream, msg
  invoke_alter "DATAGRAM", "#{stream} #{msg}"
end

#deleteObject



104
105
106
# File 'lib/skype/application.rb', line 104

def delete
  invoke_echo "DELETE APPLICATION #{@id}"
end

#disconnect(stream) ⇒ Object



100
101
102
# File 'lib/skype/application.rb', line 100

def disconnect stream
  invoke_echo "ALTER APPLICATION #{@id} DISCONNECT #{stream}"
end

#get_connectableObject Also known as: getConnectable



37
# File 'lib/skype/application.rb', line 37

def get_connectable() parse :connectable, invoke_get("CONNECTABLE") end

#get_connectingObject Also known as: getConnecting



41
# File 'lib/skype/application.rb', line 41

def get_connecting() parse :connecting, invoke_get("CONNECTING") end

#get_receivedObject Also known as: getReceived



49
# File 'lib/skype/application.rb', line 49

def get_received() parse :received, invoke_get("RECEIVED") end

#get_sendingObject Also known as: getSending



58
# File 'lib/skype/application.rb', line 58

def get_sending() parse :sending, invoke_get("SENDING") end

#get_streamsObject Also known as: getStreams



45
# File 'lib/skype/application.rb', line 45

def get_streams() parse :streams, invoke_get("STREAMS") end

#read(stream) ⇒ Object



94
95
96
97
98
# File 'lib/skype/application.rb', line 94

def read stream
  res = invoke "ALTER APPLICATION #{@id} READ #{stream}"
  res =~ /^ALTER APPLICATION #{@id} READ #{stream} (.*)$/m
  $1
end

#write(stream, msg) ⇒ Object



86
87
88
# File 'lib/skype/application.rb', line 86

def write stream, msg
  invoke_alter "WRITE", "#{stream} #{msg}"
end