Class: SkypeAPI::User
- Inherits:
-
Object
- Object
- SkypeAPI::User
- Defined in:
- lib/skype-api/user.rb
Constant Summary collapse
- @@users =
Hash.new
Class Method Summary collapse
Instance Method Summary collapse
- #about ⇒ Object
- #birthday ⇒ Object
- #blocked? ⇒ Boolean
- #cell_number ⇒ Object
- #city ⇒ Object
- #country ⇒ Object
- #handle ⇒ Object
- #home_number ⇒ Object
- #homepage ⇒ Object
- #id ⇒ Object
-
#initialize(id) ⇒ User
constructor
A new instance of User.
- #language ⇒ Object
- #last_online ⇒ Object
- #mood ⇒ Object
- #name ⇒ Object
- #nickname ⇒ Object
- #office_number ⇒ Object
- #online? ⇒ Boolean
- #online_status ⇒ Object
- #province ⇒ Object
- #set_nickname(name) ⇒ Object
- #sex ⇒ Object
- #timezone ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(id) ⇒ User
Returns a new instance of User.
10 11 12 |
# File 'lib/skype-api/user.rb', line 10 def initialize(id) @id = id end |
Class Method Details
.get_user(id) ⇒ Object
4 5 6 7 8 9 |
# File 'lib/skype-api/user.rb', line 4 def self.get_user(id) if @@users[id] == nil then @@users[id] = User.new(id) end @@users[id] end |
Instance Method Details
#about ⇒ Object
55 56 57 |
# File 'lib/skype-api/user.rb', line 55 def about get_prop("ABOUT") end |
#birthday ⇒ Object
25 26 27 |
# File 'lib/skype-api/user.rb', line 25 def birthday get_prop("BIRTHDAY") end |
#blocked? ⇒ Boolean
58 59 60 61 62 63 64 65 |
# File 'lib/skype-api/user.rb', line 58 def blocked? case get_prop("ISBLOCKED") when "TRUE" true when "FALSE" false end end |
#cell_number ⇒ Object
49 50 51 |
# File 'lib/skype-api/user.rb', line 49 def cell_number get_prop("PHONE_MOBILE") end |
#city ⇒ Object
40 41 42 |
# File 'lib/skype-api/user.rb', line 40 def city get_prop("CITY") end |
#country ⇒ Object
34 35 36 |
# File 'lib/skype-api/user.rb', line 34 def country get_prop("COUNTRY") end |
#handle ⇒ Object
16 17 18 |
# File 'lib/skype-api/user.rb', line 16 def handle @id end |
#home_number ⇒ Object
43 44 45 |
# File 'lib/skype-api/user.rb', line 43 def home_number get_prop("PHONE_HOME") end |
#homepage ⇒ Object
52 53 54 |
# File 'lib/skype-api/user.rb', line 52 def homepage get_prop("HOMEPAGE") end |
#id ⇒ Object
13 14 15 |
# File 'lib/skype-api/user.rb', line 13 def id @id end |
#language ⇒ Object
31 32 33 |
# File 'lib/skype-api/user.rb', line 31 def language get_prop("LANGUAGE") end |
#last_online ⇒ Object
73 74 75 |
# File 'lib/skype-api/user.rb', line 73 def last_online get_prop("LASTONLINETIMESTAMP") end |
#mood ⇒ Object
76 77 78 |
# File 'lib/skype-api/user.rb', line 76 def mood get_prop("MOOD_TEXT") end |
#name ⇒ Object
19 20 21 |
# File 'lib/skype-api/user.rb', line 19 def name get_prop("FULLNAME") end |
#nickname ⇒ Object
22 23 24 |
# File 'lib/skype-api/user.rb', line 22 def nickname get_prop("DISPLAYNAME") end |
#office_number ⇒ Object
46 47 48 |
# File 'lib/skype-api/user.rb', line 46 def office_number get_prop("PHONE_OFFICE") end |
#online? ⇒ Boolean
69 70 71 72 |
# File 'lib/skype-api/user.rb', line 69 def online? status = self.online_status return status == "ONLINE" || status == "DND" end |
#online_status ⇒ Object
66 67 68 |
# File 'lib/skype-api/user.rb', line 66 def online_status get_prop("ONLINESTATUS") end |
#province ⇒ Object
37 38 39 |
# File 'lib/skype-api/user.rb', line 37 def province get_prop("PROVINCE") end |
#set_nickname(name) ⇒ Object
82 83 84 |
# File 'lib/skype-api/user.rb', line 82 def set_nickname(name) SkypeAPI::exec("SET USER #{self.id} DISPLAYNAME #{name}"); end |
#sex ⇒ Object
28 29 30 |
# File 'lib/skype-api/user.rb', line 28 def sex get_prop("SEX") end |
#timezone ⇒ Object
79 80 81 |
# File 'lib/skype-api/user.rb', line 79 def timezone get_prop("TIMEZONE") end |
#to_s ⇒ Object
85 86 87 |
# File 'lib/skype-api/user.rb', line 85 def to_s self.handle end |