Sha256: 0c82b558aa94f718fa5b9c5661206312e6972da1e9a2451f7c0198a930528958

Contents?: true

Size: 390 Bytes

Versions: 4

Compression:

Stored size: 390 Bytes

Contents

# frozen_string_literal: true

module RespondForHelper
  module Flashes
    class Timestamp < Base
      def initialize(type, options = {})
        super
        @options = options.reverse_merge(timestamp: I18n.l(now))
      end

      private

      def now
        if Time.respond_to?(:zone)
          Time.zone.now
        else
          Time.now
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
respond_for_helper-1.2.0 lib/respond_for_helper/flashes/timestamp.rb
respond_for_helper-1.1.3 lib/respond_for_helper/flashes/timestamp.rb
respond_for_helper-1.1.2 lib/respond_for_helper/flashes/timestamp.rb
respond_for_helper-1.1.1 lib/respond_for_helper/flashes/timestamp.rb