Methods
Class Public methods
new(f)
Link
new(f)
Link
# File ext/tk/sample/tkbiff.rb, line 38 def initialize(f) @header = {} @body = [] while line = f.gets() line.chop! next if /^From / =~ line # skip From-line break if /^$/ =~ line # end of header if /^(\S+):\s*(.*)/ =~ line @header[attr = $1.capitalize] = $2 elsif attr sub(/^\s*/, '') @header[attr] += "\n" + $_ end end return unless $_ while line = f.gets() break if /^From / =~ line @body.push($_) end end
Instance Public methods
body()
Link