Module: Mailmate::PartLookup

Defined in:
lib/mailmate/part_lookup.rb

Class Method Summary collapse

Class Method Details

.body_parts_of(envelope_id) ⇒ Object

Returns the body-part-ids that descend from ‘envelope_id`. Returns [] for envelopes with no recorded children (single-part messages where envelope-id == body-part-id, and messages MailMate hasn’t yet indexed). Order matches ‘#root-body-part`’s id-iteration order, not MIME-tree order.



29
30
31
# File 'lib/mailmate/part_lookup.rb', line 29

def body_parts_of(envelope_id)
  inversion[envelope_id.to_i] || []
end

.reset!Object

Drop the cached inversion. Tests use this with ‘with_config` swaps; production callers use it when MailMate’s index has been rewritten on disk. Cheap — next call rebuilds lazily.



36
37
38
# File 'lib/mailmate/part_lookup.rb', line 36

def reset!
  @inversions = nil
end