Sha256: 4f7a1d697ba7965151ee5d1b5d5b70e760d5a16650babf9bcced5cda2309367a

Contents?: true

Size: 374 Bytes

Versions: 17

Compression:

Stored size: 374 Bytes

Contents

require "time"
require "date"
require "json"

class Time
  def to_json(*args)
    iso8601(6).to_json
  end
end

class Date
  def to_json(*args)
    iso8601.to_json
  end
end

class DateTime
  def to_json(*args)
    iso8601(6).to_json
  end
end

if defined?(ActiveSupport)
  class ActiveSupport::TimeWithZone
    def to_json(*args)
      iso8601(6).to_json
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
search_flip-3.2.1 lib/search_flip/to_json.rb
search_flip-3.2.0 lib/search_flip/to_json.rb
search_flip-4.0.0.beta3 lib/search_flip/to_json.rb
search_flip-4.0.0.beta2 lib/search_flip/to_json.rb
search_flip-4.0.0.beta1 lib/search_flip/to_json.rb
search_flip-4.0.0.beta lib/search_flip/to_json.rb
search_flip-3.1.2 lib/search_flip/to_json.rb
search_flip-3.1.1 lib/search_flip/to_json.rb
search_flip-3.1.0 lib/search_flip/to_json.rb
search_flip-3.0.0 lib/search_flip/to_json.rb
search_flip-3.0.0.beta6 lib/search_flip/to_json.rb
search_flip-3.0.0.beta5 lib/search_flip/to_json.rb
search_flip-3.0.0.beta4 lib/search_flip/to_json.rb
search_flip-3.0.0.beta3 lib/search_flip/to_json.rb
search_flip-3.0.0.beta2 lib/search_flip/to_json.rb
search_flip-3.0.0.beta1 lib/search_flip/to_json.rb
search_flip-3.0.0.beta lib/search_flip/to_json.rb