Class: Skype::Chat::Message

Inherits:
Object
  • Object
show all
Defined in:
lib/skype/wrappers/chat.rb

Constant Summary collapse

@@cache =
TmpCache::Cache.new

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id) ⇒ Message

Returns a new instance of Message.



38
39
40
41
42
43
44
45
# File 'lib/skype/wrappers/chat.rb', line 38

def initialize(id)
  @id = id.to_i
  if cache = @@cache.get(@id)
    @user = cache[:user]
    @body = cache[:body]
    @time = cache[:time]
  end
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



36
37
38
# File 'lib/skype/wrappers/chat.rb', line 36

def body
  @body
end

#idObject (readonly)

Returns the value of attribute id.



36
37
38
# File 'lib/skype/wrappers/chat.rb', line 36

def id
  @id
end

#timeObject (readonly)

Returns the value of attribute time.



36
37
38
# File 'lib/skype/wrappers/chat.rb', line 36

def time
  @time
end

#userObject (readonly)

Returns the value of attribute user.



36
37
38
# File 'lib/skype/wrappers/chat.rb', line 36

def user
  @user
end

Instance Method Details

#to_sObject



62
63
64
# File 'lib/skype/wrappers/chat.rb', line 62

def to_s
  "[#{time}] <#{user}> #{body} "
end