Class: Yogurt::Converters::Time
- Inherits:
-
Object
- Object
- Yogurt::Converters::Time
show all
- Extended by:
- T::Sig, ScalarConverter
- Defined in:
- lib/yogurt/converters.rb
Class Method Summary
collapse
deserialize, serialize, type_alias
Class Method Details
.deserialize(raw_value) ⇒ Object
43
44
45
46
47
|
# File 'lib/yogurt/converters.rb', line 43
def self.deserialize(raw_value)
raise "Unexpected value returned for Time: #{raw_value.inspect}" if !raw_value.is_a?(String)
::Time.iso8601(raw_value)
end
|
.serialize(value) ⇒ Object
38
39
40
|
# File 'lib/yogurt/converters.rb', line 38
def self.serialize(value)
value.iso8601
end
|
.type_alias ⇒ Object
33
34
35
|
# File 'lib/yogurt/converters.rb', line 33
def self.type_alias
T.type_alias {::Time}
end
|