Class: ActiveGraph::Shared::TypeConverters::DateConverter
Overview
Converts Java long types to Date objects. Must be timezone UTC.
Class Method Summary
collapse
converted?, #supports_array?
Class Method Details
.convert_type ⇒ Object
120
121
122
|
# File 'lib/active_graph/shared/type_converters.rb', line 120
def convert_type
Date
end
|
.db_type ⇒ Object
124
125
126
|
# File 'lib/active_graph/shared/type_converters.rb', line 124
def db_type
Date
end
|
.to_ruby(value) ⇒ Object
Also known as:
to_db
128
129
130
|
# File 'lib/active_graph/shared/type_converters.rb', line 128
def to_ruby(value)
value.respond_to?(:to_date) ? value.to_date : Time.at(value).utc.to_date
end
|