Class: Loveseat::Document::Property::Time

Inherits:
Base
  • Object
show all
Defined in:
lib/loveseat/document/property/time.rb

Instance Attribute Summary

Attributes inherited from Base

#value

Class Method Summary collapse

Methods inherited from Base

#empty?, #get, #initialize, #set

Constructor Details

This class inherits a constructor from Loveseat::Document::Property::Base

Class Method Details

.cast(value) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/loveseat/document/property/time.rb', line 7

def self.cast(value)
  if value.is_a?(::Time)
    return value
  end

  ::Time.parse(value)
end