Sha256: 8611daafdd71ff5bd43cff0d741d748ddb7af28ecc120ba5a09c095c1a11ec71

Contents?: true

Size: 302 Bytes

Versions: 20

Compression:

Stored size: 302 Bytes

Contents

module IntercomRails
  class DateHelper
    def self.convert_dates_to_unix_timestamps(object)
      return Hash[object.map { |k, v| [k, convert_dates_to_unix_timestamps(v)] }] if object.is_a?(Hash)
      return object.to_i if object.is_a?(Time) || object.is_a?(DateTime)
      object
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
intercom-rails-0.3.2 lib/intercom-rails/date_helper.rb
intercom-rails-0.3.1 lib/intercom-rails/date_helper.rb
intercom-rails-0.3.0 lib/intercom-rails/date_helper.rb
intercom-rails-0.2.36 lib/intercom-rails/date_helper.rb
intercom-rails-0.2.35 lib/intercom-rails/date_helper.rb
intercom-rails-0.2.34 lib/intercom-rails/date_helper.rb
intercom-rails-0.2.33 lib/intercom-rails/date_helper.rb
intercom-rails-0.2.31 lib/intercom-rails/date_helper.rb
intercom-rails-0.2.30 lib/intercom-rails/date_helper.rb
intercom-rails-0.2.29 lib/intercom-rails/date_helper.rb
intercom-rails-0.2.28 lib/intercom-rails/date_helper.rb
intercom-rails-0.2.27 lib/intercom-rails/date_helper.rb
intercom-rails-0.2.26 lib/intercom-rails/date_helper.rb
intercom-rails-0.2.25 lib/intercom-rails/date_helper.rb
intercom-rails-0.2.24 lib/intercom-rails/date_helper.rb
intercom-rails-0.2.23 lib/intercom-rails/date_helper.rb
intercom-rails-0.2.22 lib/intercom-rails/date_helper.rb
intercom-rails-0.2.21 lib/intercom-rails/date_helper.rb
intercom-rails-0.2.20 lib/intercom-rails/date_helper.rb
intercom-rails-0.2.19 lib/intercom-rails/date_helper.rb