Class: TMail::MhMailbox

### Home Classes Methods

### In Files

- lib/tmail/mailbox.rb

### Parent

Object

### Methods

- ::new
- #close
- #directory
- #dirname
- #each
- #each_new_port
- #each_port
- #inspect
- #new_port
- #reverse_each
- #reverse_each_port

### Files

- CHANGES
- LICENSE
- NOTES
- README
- Rakefile
- MANIFEST
- Makefile
- depend
- Makefile
- COPYING
- README

### Class/Module Index

Quicksearch

- TMail
- TMail::Address
- TMail::AddressGroup
- TMail::AddressHeader
- TMail::Attachment
- TMail::ContentDispositionHeader
- TMail::ContentTransferEncodingHeader
- TMail::ContentTypeHeader
- TMail::DateTimeHeader
- TMail::EncryptedHeader
- TMail::FilePort
- TMail::HeaderField
- TMail::KeywordsHeader
- TMail::Mail
- TMail::MailFlags
- TMail::Maildir
- TMail::MaildirLoader
- TMail::MaildirPort
- TMail::MboxLoader
- TMail::MessageIdHeader
- TMail::MhLoader
- TMail::MhMailbox
- TMail::MhPort
- TMail::MimeVersionHeader
- TMail::Parser
- TMail::Port
- TMail::ReceivedHeader
- TMail::ReferencesHeader
- TMail::ReturnPathHeader
- TMail::SingleAddressHeader
- TMail::StringPort
- TMail::StructuredHeader
- TMail::SyntaxError
- TMail::TMailScanner
- TMail::TextUtils
- TMail::UNIXMbox
- TMail::UnstructuredHeader
- CharDet
- CharDet::Big5DistributionAnalysis
- CharDet::Big5Prober
- CharDet::CharDistributionAnalysis
- CharDet::CharSetGroupProber
- CharDet::CharSetProber
- CharDet::CodingStateMachine
- CharDet::EUCJPContextAnalysis
- CharDet::EUCJPDistributionAnalysis
- CharDet::EUCJPProber
- CharDet::EUCKRDistributionAnalysis
- CharDet::EUCKRProber
- CharDet::EUCTWDistributionAnalysis
- CharDet::EUCTWProber
- CharDet::EscCharSetProber
- CharDet::GB2312DistributionAnalysis
- CharDet::GB2312Prober
- CharDet::HebrewProber
- CharDet::JapaneseContextAnalysis
- CharDet::Latin1Prober
- CharDet::MBCSGroupProber
- CharDet::MultiByteCharSetProber
- CharDet::SBCSGroupProber
- CharDet::SJISContextAnalysis
- CharDet::SJISDistributionAnalysis
- CharDet::SJISProber
- CharDet::SingleByteCharSetProber
- CharDet::UTF8Prober
- CharDet::UniversalDetector

No matching classes.

# TMail::MhMailbox

### Constants

PORT_CLASS

### Attributes

last_atime[RW]

### Public Class Methods

new( dir ) click to toggle source

    # File lib/tmail/mailbox.rb, line 52
    def initialize( dir )
      edir = File.expand_path(dir)
      raise ArgumentError, "not directory: #{dir}"                               unless FileTest.directory? edir
      @dirname = edir
      @last_file = nil
      @last_atime = nil
    end

### Public Instance Methods

close() click to toggle source

    # File lib/tmail/mailbox.rb, line 73
    def close
    end

directory() click to toggle source

    # File lib/tmail/mailbox.rb, line 61
    def directory
      @dirname
    end

Also aliased as: dirname
dirname() click to toggle source
Alias for: directory
each() click to toggle source
Alias for: each_port
each_new_port( mtime = nil, &block ) click to toggle source

    old #each_mail returns Port

def each_mail

    each_port do |port|
      yield Mail.new(port)
    end

end

    # File lib/tmail/mailbox.rb, line 105
    def each_new_port( mtime = nil, &block )
      mtime ||= @last_atime
      return each_port(&block) unless mtime
      return unless File.mtime(@dirname) >= mtime

      mail_files().each do |path|
        yield PORT_CLASS.new(path) if File.mtime(path) > mtime
      end
      @last_atime = Time.now
    end

each_port() click to toggle source

    # File lib/tmail/mailbox.rb, line 80
    def each_port
      mail_files().each do |path|
        yield PORT_CLASS.new(path)
      end
      @last_atime = Time.now
    end

Also aliased as: each
inspect() click to toggle source

    # File lib/tmail/mailbox.rb, line 69
    def inspect
      "#<#{self.class} #{@dirname}>"
    end

new_port() click to toggle source

    # File lib/tmail/mailbox.rb, line 76
    def new_port
      PORT_CLASS.new(next_file_name())
    end

reverse_each() click to toggle source
Alias for: reverse_each_port
reverse_each_port() click to toggle source

    # File lib/tmail/mailbox.rb, line 89
    def reverse_each_port
      mail_files().reverse_each do |path|
        yield PORT_CLASS.new(path)
      end
      @last_atime = Time.now
    end

Also aliased as: reverse_each

[Validate]

Generated with the Darkfish Rdoc Generator 2.