Module: Insightly2::Resources::Object::Serializers::Time

Defined in:
lib/insightly2/resources/object/serializers.rb

Class Method Summary collapse

Class Method Details

.deserialize(value) ⇒ Object



29
30
31
32
# File 'lib/insightly2/resources/object/serializers.rb', line 29

def self.deserialize(value)
  # Returning value that was sent to insightly.
  ::Time.parse(value).strftime('%Y-%m-%d %H:%M:%S')
end

.serialize(value) ⇒ Object

Insightly only accepts time in the following format.



25
26
27
# File 'lib/insightly2/resources/object/serializers.rb', line 25

def self.serialize(value)
  value.strftime('%Y-%m-%d %H:%M:%S')
end