Class: Mbox::Mail::Metadata

Inherits:
Object
  • Object
show all
Defined in:
lib/mbox/mail/metadata.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeMetadata

Returns a new instance of Metadata.



25
26
27
# File 'lib/mbox/mail/metadata.rb', line 25

def initialize
	@from = []
end

Instance Attribute Details

#fromObject (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