Class: Hermeneutics::Multipart::PartFile
- Inherits:
-
Object
- Object
- Hermeneutics::Multipart::PartFile
- Defined in:
- lib/hermeneutics/message.rb
Overview
:stopdoc:
Instance Attribute Summary collapse
-
#epilog ⇒ Object
readonly
Returns the value of attribute epilog.
-
#prolog ⇒ Object
readonly
Returns the value of attribute prolog.
Class Method Summary collapse
Instance Method Summary collapse
- #eat_lines ⇒ Object
-
#initialize(file, sep) ⇒ PartFile
constructor
A new instance of PartFile.
- #next_part ⇒ Object
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
#epilog ⇒ Object (readonly)
Returns the value of attribute epilog.
80 81 82 |
# File 'lib/hermeneutics/message.rb', line 80 def epilog @epilog end |
#prolog ⇒ Object (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
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_lines ⇒ Object
93 94 95 |
# File 'lib/hermeneutics/message.rb', line 93 def eat_lines yield @a.pop while @a.any? end |
#next_part ⇒ Object
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 |