Class: Skype::Chat::Message
- Inherits:
-
Object
- Object
- Skype::Chat::Message
- Defined in:
- lib/skype/wrappers/chat.rb
Constant Summary collapse
- @@cache =
TmpCache::Cache.new
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#time ⇒ Object
readonly
Returns the value of attribute time.
-
#user ⇒ Object
readonly
Returns the value of attribute user.
Instance Method Summary collapse
-
#initialize(id) ⇒ Message
constructor
A new instance of Message.
- #to_s ⇒ Object
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
#body ⇒ Object (readonly)
Returns the value of attribute body.
36 37 38 |
# File 'lib/skype/wrappers/chat.rb', line 36 def body @body end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
36 37 38 |
# File 'lib/skype/wrappers/chat.rb', line 36 def id @id end |
#time ⇒ Object (readonly)
Returns the value of attribute time.
36 37 38 |
# File 'lib/skype/wrappers/chat.rb', line 36 def time @time end |
#user ⇒ Object (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_s ⇒ Object
62 63 64 |
# File 'lib/skype/wrappers/chat.rb', line 62 def to_s "[#{time}] <#{user}> #{body} " end |