Class: Jabbot::Bot::Message
- Inherits:
-
Struct
- Object
- Struct
- Jabbot::Bot::Message
- Defined in:
- lib/jabbot/bot.rb
Instance Attribute Summary collapse
-
#text ⇒ Object
Returns the value of attribute text.
-
#time ⇒ Object
Returns the value of attribute time.
-
#type ⇒ Object
Returns the value of attribute type.
-
#user ⇒ Object
Returns the value of attribute user.
Instance Method Summary collapse
-
#to_json(*a) ⇒ Object
Encode a message in JSON A message is just a hash of its values.
- #to_s ⇒ Object
Instance Attribute Details
#text ⇒ Object
Returns the value of attribute text
16 17 18 |
# File 'lib/jabbot/bot.rb', line 16 def text @text end |
#time ⇒ Object
Returns the value of attribute time
16 17 18 |
# File 'lib/jabbot/bot.rb', line 16 def time @time end |
#type ⇒ Object
Returns the value of attribute type
16 17 18 |
# File 'lib/jabbot/bot.rb', line 16 def type @type end |
#user ⇒ Object
Returns the value of attribute user
16 17 18 |
# File 'lib/jabbot/bot.rb', line 16 def user @user end |
Instance Method Details
#to_json(*a) ⇒ Object
Encode a message in JSON A message is just a hash of its values
23 24 25 26 27 28 29 30 |
# File 'lib/jabbot/bot.rb', line 23 def to_json(*a) { :user => user, :text => text, :time => time, :type => type }.to_json(*a) end |
#to_s ⇒ Object
17 18 19 |
# File 'lib/jabbot/bot.rb', line 17 def to_s "#{user}: #{text}" end |