Sha256: ad6fe85bfe5213dd52e9ae2b019a53965028c0e5c90437d0b25fec67e530905e

Contents?: true

Size: 695 Bytes

Versions: 45

Compression:

Stored size: 695 Bytes

Contents

module Selenium
  module WebDriver
    module JsonHelper

      # ActiveSupport may define Object#load, so we can't use MultiJson.respond_to? here
      sm = MultiJson.singleton_methods.map { |e| e.to_sym }

      if sm.include? :load
        # @api private
        def json_load(obj)
          MultiJson.load(obj)
        end
      else
        # @api private
        def json_load(obj)
          MultiJson.decode(obj)
        end
      end

      if sm.include? :dump
        # @api private
        def json_dump(obj)
          MultiJson.dump(obj)
        end
      else
        # @api private
        def json_dump(obj)
          MultiJson.encode(obj)
        end
      end

    end
  end
end

Version data entries

45 entries across 45 versions & 3 rubygems

Version Path
selenium-webdriver-2.22.1 lib/selenium/webdriver/common/json_helper.rb
selenium-webdriver-2.22.0 lib/selenium/webdriver/common/json_helper.rb
selenium-webdriver-2.22.0.rc3 lib/selenium/webdriver/common/json_helper.rb
selenium-webdriver-2.22.0.rc2 lib/selenium/webdriver/common/json_helper.rb
selenium-webdriver-2.22.0.rc1 lib/selenium/webdriver/common/json_helper.rb