Module: Mail::CommonDate::InstanceMethods
- Defined in:
- lib/mail/fields/common/common_date.rb
Overview
:doc:
Instance Method Summary collapse
-
#date_time ⇒ Object
Returns a date time object of the parsed date.
- #default ⇒ Object
- #parse(val = value) ⇒ Object
Instance Method Details
permalink #date_time ⇒ Object
Returns a date time object of the parsed date
8 9 10 |
# File 'lib/mail/fields/common/common_date.rb', line 8 def date_time ::DateTime.parse("#{element.date_string} #{element.time_string}") end |
permalink #default ⇒ Object
[View source]
12 13 14 |
# File 'lib/mail/fields/common/common_date.rb', line 12 def default date_time end |
permalink #parse(val = value) ⇒ Object
[View source]
16 17 18 19 20 21 22 23 |
# File 'lib/mail/fields/common/common_date.rb', line 16 def parse(val = value) unless val.blank? @element = Mail::DateTimeElement.new(val) @tree = @element.tree else nil end end |