Class: CampfireChat::Message

Inherits:
Object
  • Object
show all
Defined in:
lib/campfire_chat/message.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(raw_message) ⇒ Message

Returns a new instance of Message.



4
5
6
7
8
# File 'lib/campfire_chat/message.rb', line 4

def initialize(raw_message)
  @author = raw_message.user.name
  @body = raw_message.body
  @id = raw_message.id
end

Instance Attribute Details

#authorObject (readonly)

Returns the value of attribute author.



3
4
5
# File 'lib/campfire_chat/message.rb', line 3

def author
  @author
end

#bodyObject (readonly)

Returns the value of attribute body.



3
4
5
# File 'lib/campfire_chat/message.rb', line 3

def body
  @body
end

#idObject (readonly)

Returns the value of attribute id.



3
4
5
# File 'lib/campfire_chat/message.rb', line 3

def id
  @id
end