Class: InboxSync::Sync::MailItemGroup

Inherits:
Object
  • Object
show all
Defined in:
lib/inbox-sync/sync/mail_item_group.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#itemsObject (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

#threadObject (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

#idObject



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

#joinObject



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