Class: InboxSync::Sync::MailItemGroup
- Inherits:
-
Object
- Object
- InboxSync::Sync::MailItemGroup
- Defined in:
- lib/inbox-sync/sync/mail_item_group.rb
Instance Attribute Summary collapse
-
#items ⇒ Object
readonly
Returns the value of attribute items.
-
#thread ⇒ Object
readonly
Returns the value of attribute thread.
Instance Method Summary collapse
- #add(mail_item) ⇒ Object
- #id ⇒ Object
-
#initialize(sync) ⇒ MailItemGroup
constructor
A new instance of MailItemGroup.
- #join ⇒ Object
- #run(runner = nil) ⇒ Object
Constructor Details
#initialize(sync) ⇒ MailItemGroup
Returns a new instance of MailItemGroup.
8 9 10 11 12 |
# File 'lib/inbox-sync/sync/mail_item_group.rb', line 8 def initialize(sync) @sync = sync @thread = nil @items = [] end |
Instance Attribute Details
#items ⇒ Object (readonly)
Returns the value of attribute items.
6 7 8 |
# File 'lib/inbox-sync/sync/mail_item_group.rb', line 6 def items @items end |
#thread ⇒ Object (readonly)
Returns the value of attribute thread.
6 7 8 |
# File 'lib/inbox-sync/sync/mail_item_group.rb', line 6 def thread @thread end |
Instance Method Details
#add(mail_item) ⇒ Object
18 19 20 |
# File 'lib/inbox-sync/sync/mail_item_group.rb', line 18 def add(mail_item) @items << mail_item end |
#id ⇒ Object
14 15 16 |
# File 'lib/inbox-sync/sync/mail_item_group.rb', line 14 def id "#<#{self.class}:#{'0x%x' % (self.object_id << 1)}>" end |
#join ⇒ Object
27 28 29 30 |
# File 'lib/inbox-sync/sync/mail_item_group.rb', line 27 def join @thread.join @runner = nil end |
#run(runner = nil) ⇒ Object
22 23 24 25 |
# File 'lib/inbox-sync/sync/mail_item_group.rb', line 22 def run(runner=nil) @runner = runner @thread = Thread.new { run_items_thread } end |