Class: SkypeAPI::Chat
- Inherits:
-
Object
- Object
- SkypeAPI::Chat
- Defined in:
- lib/skype-api/chat.rb
Constant Summary collapse
- @@chats =
Hash.new
Class Method Summary collapse
- .bookmarked_chats ⇒ Object
- .chats ⇒ Object
- .get_chat(id) ⇒ Object
- .recent_chats ⇒ Object
- .unread_chats ⇒ Object
Instance Method Summary collapse
- #active_members ⇒ Object
- #adder ⇒ Object
- #creation_timestamp ⇒ Object
- #friendly_name ⇒ Object
- #id ⇒ Object
-
#initialize(id) ⇒ Chat
constructor
A new instance of Chat.
- #members ⇒ Object
- #messages ⇒ Object
- #post(msg) ⇒ Object
- #posters ⇒ Object
- #set_topic(topic) ⇒ Object
- #status ⇒ Object
- #to_s ⇒ Object
- #topic ⇒ Object
Constructor Details
#initialize(id) ⇒ Chat
Returns a new instance of Chat.
26 27 28 |
# File 'lib/skype-api/chat.rb', line 26 def initialize(id) @id = id end |
Class Method Details
.bookmarked_chats ⇒ Object
16 17 18 19 |
# File 'lib/skype-api/chat.rb', line 16 def self.bookmarked_chats() recieved_chats = SkypeAPI::exec("SEARCH BOOKMARKEDCHATS"); recieved_chats.sub("CHATS ","").split(", ").map {|chat| get_chat(chat)} end |
.chats ⇒ Object
4 5 6 7 |
# File 'lib/skype-api/chat.rb', line 4 def self.chats() recieved_chats = SkypeAPI::exec("SEARCH CHATS"); recieved_chats.sub("CHATS ","").split(", ").map {|chat| get_chat(chat)} end |
.get_chat(id) ⇒ Object
20 21 22 23 24 25 |
# File 'lib/skype-api/chat.rb', line 20 def self.get_chat(id) if @@chats[id] == nil @@chats[id] = Chat.new(id); end @@chats[id]; end |
Instance Method Details
#active_members ⇒ Object
53 54 55 |
# File 'lib/skype-api/chat.rb', line 53 def active_members get_prop("ACTIVEMEMBERS"); end |
#adder ⇒ Object
38 39 40 |
# File 'lib/skype-api/chat.rb', line 38 def adder get_prop("ADDER"); end |
#creation_timestamp ⇒ Object
41 42 43 |
# File 'lib/skype-api/chat.rb', line 41 def get_prop("TIMESTAMP"); end |
#friendly_name ⇒ Object
56 57 58 59 |
# File 'lib/skype-api/chat.rb', line 56 def friendly_name get_prop("FRIENDLYNAME"); end |
#id ⇒ Object
35 36 37 |
# File 'lib/skype-api/chat.rb', line 35 def id @id end |
#members ⇒ Object
29 30 31 |
# File 'lib/skype-api/chat.rb', line 29 def members get_prop("MEMBERS").split(" ").map {|name| User.get_user(name)}; end |
#messages ⇒ Object
50 51 52 |
# File 'lib/skype-api/chat.rb', line 50 def get_prop("RECENTCHATMESSAGES").split(", ").map {|| Message.new()}; end |
#post(msg) ⇒ Object
60 61 62 |
# File 'lib/skype-api/chat.rb', line 60 def post(msg) SkypeAPI::exec("CHATMESSAGE #{self.id} #{msg}"); end |
#posters ⇒ Object
47 48 49 |
# File 'lib/skype-api/chat.rb', line 47 def posters get_prop("POSTERS") end |
#set_topic(topic) ⇒ Object
63 64 65 |
# File 'lib/skype-api/chat.rb', line 63 def set_topic(topic) SkypeAPI::exec("SET CHAT #{self.id} TOPIC #{topic}"); end |
#status ⇒ Object
44 45 46 |
# File 'lib/skype-api/chat.rb', line 44 def status get_prop("STATUS") end |
#to_s ⇒ Object
66 67 68 |
# File 'lib/skype-api/chat.rb', line 66 def to_s @id.to_s end |
#topic ⇒ Object
32 33 34 |
# File 'lib/skype-api/chat.rb', line 32 def topic get_prop("TOPIC"); end |