Class: Hermeneutics::Multipart::PartFile

Inherits:
Object
  • Object
show all
Defined in:
lib/hermeneutics/message.rb

Overview

:stopdoc:

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file, sep) ⇒ PartFile

Returns a new instance of PartFile.



81
82
83
84
85
86
# File 'lib/hermeneutics/message.rb', line 81

def initialize file, sep
  @file = file
  @sep = /^--#{Regexp.quote sep}(--)?/
  read_part
  @prolog = norm_nl @a
end

Instance Attribute Details

#epilogObject (readonly)

Returns the value of attribute epilog.



80
81
82
# File 'lib/hermeneutics/message.rb', line 80

def epilog
  @epilog
end

#prologObject (readonly)

Returns the value of attribute prolog.



80
81
82
# File 'lib/hermeneutics/message.rb', line 80

def prolog
  @prolog
end

Class Method Details

.open(file, sep) {|i| ... } ⇒ Object

Yields:

  • (i)


73
74
75
76
# File 'lib/hermeneutics/message.rb', line 73

def open file, sep
  i = new file, sep
  yield i
end

Instance Method Details

#eat_linesObject



93
94
95
# File 'lib/hermeneutics/message.rb', line 93

def eat_lines
  yield @a.pop while @a.any?
end

#next_partObject



87
88
89
90
91
92
# File 'lib/hermeneutics/message.rb', line 87

def next_part
  return if @epilog
  read_part
  @a.first.chomp!
  true
end