Class: Chatbox::Message
- Inherits:
-
Object
- Object
- Chatbox::Message
- Includes:
- FakeMissingKeywords
- Defined in:
- lib/chatbox/message.rb
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(record: req(:record), store: req(:store)) ⇒ Message
constructor
A new instance of Message.
- #mark_as_read! ⇒ Object
- #mark_as_unread! ⇒ Object
- #read? ⇒ Boolean
Methods included from FakeMissingKeywords
Constructor Details
#initialize(record: req(:record), store: req(:store)) ⇒ Message
Returns a new instance of Message.
7 8 9 10 |
# File 'lib/chatbox/message.rb', line 7 def initialize(record: req(:record), store: req(:store)) @record = record @store = store end |
Instance Method Details
#==(other) ⇒ Object
28 29 30 |
# File 'lib/chatbox/message.rb', line 28 def ==(other) other.is_a?(self.class) && record == other.record && store == other.store end |
#mark_as_read! ⇒ Object
18 19 20 21 |
# File 'lib/chatbox/message.rb', line 18 def mark_as_read! store. id @record = store. id end |
#mark_as_unread! ⇒ Object
23 24 25 26 |
# File 'lib/chatbox/message.rb', line 23 def mark_as_unread! store. id @record = store. id end |
#read? ⇒ Boolean
14 15 16 |
# File 'lib/chatbox/message.rb', line 14 def read? record.read end |