Class: Thunderbird::Mbox
- Inherits:
-
Object
- Object
- Thunderbird::Mbox
- Defined in:
- lib/thunderbird/mbox.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #each(&block) ⇒ Object
-
#initialize(path:) ⇒ Mbox
constructor
A new instance of Mbox.
Constructor Details
#initialize(path:) ⇒ Mbox
Returns a new instance of Mbox.
9 10 11 |
# File 'lib/thunderbird/mbox.rb', line 9 def initialize(path:) @path = path end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
7 8 9 |
# File 'lib/thunderbird/mbox.rb', line 7 def path @path end |
Instance Method Details
#each(&block) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/thunderbird/mbox.rb', line 13 def each(&block) content = File.read(index_path) data = parser.data(content) = data.tables[MESSAGE_NAMESPACE]["1"] File.open(path) do |file| .each do |id, | = ["offlineMsgSize"] length = .to_i(16) = file.read(length) block.call(id, ) end end end |