Class: Chotto::MessageThread
- Inherits:
-
Object
- Object
- Chotto::MessageThread
- Defined in:
- lib/chotto/message_thread.rb
Instance Attribute Summary collapse
-
#db ⇒ Object
readonly
Returns the value of attribute db.
-
#thread_id ⇒ Object
readonly
Returns the value of attribute thread_id.
Instance Method Summary collapse
- #each ⇒ Object
-
#initialize(thread_id:, db:) ⇒ MessageThread
constructor
A new instance of MessageThread.
Constructor Details
#initialize(thread_id:, db:) ⇒ MessageThread
Returns a new instance of MessageThread.
7 8 9 10 |
# File 'lib/chotto/message_thread.rb', line 7 def initialize(thread_id:, db:) @thread_id = thread_id @db = db end |
Instance Attribute Details
#db ⇒ Object (readonly)
Returns the value of attribute db.
5 6 7 |
# File 'lib/chotto/message_thread.rb', line 5 def db @db end |
#thread_id ⇒ Object (readonly)
Returns the value of attribute thread_id.
5 6 7 |
# File 'lib/chotto/message_thread.rb', line 5 def thread_id @thread_id end |
Instance Method Details
#each ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'lib/chotto/message_thread.rb', line 12 def each db.("thread:#{thread_id}").each do |msg| yield( Message.new( msg: msg, db: db )) end end |