Sha256: c59c1fb7b8aa8aaa5c1ce4bf1f0916acc07e855e43ae7a161c03fd4ede928cf6
Contents?: true
Size: 809 Bytes
Versions: 13
Compression:
Stored size: 809 Bytes
Contents
module Twilio def self.serialize_iso8601(date) if date date.iso8601 end end def self.deserialize_rfc2822(date) unless date.nil? Time.rfc2822(date) end end def self.deserialize_iso8601(date) unless date.nil? Time.parse(date) end end def self.flatten(map, result={}, previous=[]) map.each do |key, value| if value.is_a? Hash self.flatten(value, result, previous + [key]) else result[(previous + [key]).join('.')] = value end end result end def self.prefixed_collapsible_map(map, prefix) result = {} if map.is_a? Hash flattened = self.flatten(map) result = {} flattened.each do |key, value| result[prefix + '.' + key] = value end end result end end
Version data entries
13 entries across 13 versions & 1 rubygems