Class: Time

Inherits:
Object
  • Object
show all
Defined in:
lib/xommelier/core_ext/time.rb

Direct Known Subclasses

Xommelier::Common::Time822

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.from_xommelier(value) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/xommelier/core_ext/time.rb', line 11

def self.from_xommelier(value)
  return if value.nil?
  case value
  when String
    Time.xmlschema(value)
  when Time
    value
  else
    raise Xommelier::TypeError.new(value, Time)
  end
end

Instance Method Details

#to_xommelierObject



23
24
25
# File 'lib/xommelier/core_ext/time.rb', line 23

def to_xommelier
  xmlschema
end