Class: Prototok::Serializers::Time
- Defined in:
- lib/prototok/serializers/time.rb
Constant Summary
Constants inherited from Base
Instance Attribute Summary
Attributes inherited from Base
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Base
apply_key_ops!, apply_op, attribute, attribute_storage, check_value, #initialize, key_ops
Constructor Details
This class inherits a constructor from Prototok::Serializers::Base
Class Method Details
.decode(value) ⇒ Object
10 11 12 |
# File 'lib/prototok/serializers/time.rb', line 10 def self.decode value ::Time.iso8601(value) end |
Instance Method Details
#encode ⇒ Object
6 7 8 |
# File 'lib/prototok/serializers/time.rb', line 6 def encode @object && @object.iso8601(Prototok.config[:time_encoding_precision]) end |