Class: Mail::ReceivedElement

Inherits:
Object
  • Object
show all
Defined in:
lib/mail/elements/received_element.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(string) ⇒ ReceivedElement

Returns a new instance of ReceivedElement.



11
12
13
14
15
16
17
18
19
20
# File 'lib/mail/elements/received_element.rb', line 11

def initialize(string)
  if Utilities.blank? string
    @date_time = nil
    @info = nil
  else
    received = Mail::Parsers::ReceivedParser.parse(string)
    @date_time = datetime_for(received)
    @info = received.info
  end
end

Instance Attribute Details

#date_timeObject (readonly)

Returns the value of attribute date_time.



9
10
11
# File 'lib/mail/elements/received_element.rb', line 9

def date_time
  @date_time
end

#infoObject (readonly)

Returns the value of attribute info.



9
10
11
# File 'lib/mail/elements/received_element.rb', line 9

def info
  @info
end

Instance Method Details

#to_s(*args) ⇒ Object



22
23
24
# File 'lib/mail/elements/received_element.rb', line 22

def to_s(*args)
  "#{info}; #{date_time.to_s(*args)}"
end