Class: Graft::Xml::Type::Time
- Inherits:
-
Graft::Xml::Type
- Object
- Graft::Xml::Type
- Graft::Xml::Type::Time
- Defined in:
- lib/graft/xml/type.rb
Overview
Time
Instance Method Summary collapse
Methods inherited from Graft::Xml::Type
#convertible?, #initialize, #value
Constructor Details
This class inherits a constructor from Graft::Xml::Type
Instance Method Details
#convert ⇒ Object
73 74 75 |
# File 'lib/graft/xml/type.rb', line 73 def convert ? ::Time.at(@source.to_i) : ::Time.parse(@source) end |
#timestamp? ⇒ Boolean
69 70 71 |
# File 'lib/graft/xml/type.rb', line 69 def !@source.match(/^\d+$/).nil? end |