Class: Mbox::Mail::Metadata
- Inherits:
-
Object
- Object
- Mbox::Mail::Metadata
- Defined in:
- lib/mbox/mail/metadata.rb
Instance Attribute Summary collapse
-
#from ⇒ Object
readonly
Returns the value of attribute from.
Instance Method Summary collapse
-
#initialize ⇒ Metadata
constructor
A new instance of Metadata.
- #parse_from(line) ⇒ Object
Constructor Details
#initialize ⇒ Metadata
Returns a new instance of Metadata.
25 26 27 |
# File 'lib/mbox/mail/metadata.rb', line 25 def initialize @from = [] end |
Instance Attribute Details
#from ⇒ Object (readonly)
Returns the value of attribute from.
23 24 25 |
# File 'lib/mbox/mail/metadata.rb', line 23 def from @from end |
Instance Method Details
#parse_from(line) ⇒ Object
29 30 31 32 33 |
# File 'lib/mbox/mail/metadata.rb', line 29 def parse_from (line) line.match /^>*From ([^\s]+) (.{24})/ do |m| @from << Struct.new(:name, :date).new(m[1], m[2]) end end |