Class: EJSONExt::Encoders::TimeType
- Inherits:
-
DefaultType
- Object
- DefaultType
- EJSONExt::Encoders::TimeType
- Defined in:
- lib/ejson_ext/encoders/time_type.rb
Instance Method Summary collapse
Methods inherited from DefaultType
#initialize, #next_handler, #next_handler=, #parse
Constructor Details
This class inherits a constructor from EJSONExt::Encoders::DefaultType
Instance Method Details
#handler? ⇒ Boolean
4 5 6 |
# File 'lib/ejson_ext/encoders/time_type.rb', line 4 def handler? @value.is_a?(Time) end |
#value ⇒ Object
8 9 10 |
# File 'lib/ejson_ext/encoders/time_type.rb', line 8 def value { '$date' => (@value.to_i * 1_000) } end |