Method: ApimaticCalculator::DateTimeHelper.to_unix_array
- Defined in:
- lib/apimatic_calculator/utilities/date_time_helper.rb
.to_unix_array(date_time, hash, key) ⇒ hash
Safely converts an array of DateTime objects into a map of unix format string
78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/apimatic_calculator/utilities/date_time_helper.rb', line 78 def self.to_unix_array(date_time, hash, key) return if date_time.nil? hash[key] = date_time.map do |v| if v.is_a?(BaseModel) v.to_hash else v.is_a?(DateTime) ? DateTimeHelper.to_unix(v) : v end end end |