Sha256: 035f16b1791412603f99cfa9e34b015f2a8007cf986700f2d0eb409df68c17ca

Contents?: true

Size: 348 Bytes

Versions: 18

Compression:

Stored size: 348 Bytes

Contents

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

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

class Date
  def to_json
    iso8601.to_json
  end
end

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

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

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
search_flip-2.3.2 lib/search_flip/to_json.rb
search_flip-2.3.1 lib/search_flip/to_json.rb
search_flip-2.3.0 lib/search_flip/to_json.rb
search_flip-2.2.0 lib/search_flip/to_json.rb
search_flip-2.1.0 lib/search_flip/to_json.rb
search_flip-2.1.0.beta2 lib/search_flip/to_json.rb
search_flip-2.1.0.beta1 lib/search_flip/to_json.rb
search_flip-2.0.0 lib/search_flip/to_json.rb
search_flip-2.0.0.beta8 lib/search_flip/to_json.rb
search_flip-2.0.0.beta7 lib/search_flip/to_json.rb
search_flip-2.0.0.beta6 lib/search_flip/to_json.rb
search_flip-2.0.0.beta5 lib/search_flip/to_json.rb
search_flip-2.0.0.beta4 lib/search_flip/to_json.rb
search_flip-2.0.0.beta3 lib/search_flip/to_json.rb
search_flip-2.0.0.beta2 lib/search_flip/to_json.rb
search_flip-2.0.0.beta lib/search_flip/to_json.rb
search_flip-1.1.0 lib/search_flip/to_json.rb
search_flip-1.0.0 lib/search_flip/to_json.rb