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.45.0 lib/selenium/webdriver/common/json_helper.rb
selenium-webdriver-2.45.0.dev3 lib/selenium/webdriver/common/json_helper.rb
selenium-webdriver-2.45.0.dev2 lib/selenium/webdriver/common/json_helper.rb
selenium-webdriver-2.45.0.dev lib/selenium/webdriver/common/json_helper.rb
selenium-webdriver-2.44.0 lib/selenium/webdriver/common/json_helper.rb
selenium-webdriver-2.44.0.dev lib/selenium/webdriver/common/json_helper.rb
selenium-webdriver-2.43.0 lib/selenium/webdriver/common/json_helper.rb
selenium-webdriver-2.42.0 lib/selenium/webdriver/common/json_helper.rb
selenium-webdriver-2.41.0 lib/selenium/webdriver/common/json_helper.rb
browserstack-webdriver-2.40.1 lib/selenium/webdriver/common/json_helper.rb
selenium-webdriver-2.40.0 lib/selenium/webdriver/common/json_helper.rb
selenium-webdriver-2.40.0.rc2 lib/selenium/webdriver/common/json_helper.rb
selenium-webdriver-2.40.0.rc1 lib/selenium/webdriver/common/json_helper.rb
selenium-webdriver-2.39.0 lib/selenium/webdriver/common/json_helper.rb
selenium-webdriver-2.38.0 lib/selenium/webdriver/common/json_helper.rb
browserstack-webdriver-0.0.22 lib/selenium/webdriver/common/json_helper.rb
browserstack-webdriver-0.0.1 lib/selenium/webdriver/common/json_helper.rb
selenium-webdriver-2.37.0 lib/selenium/webdriver/common/json_helper.rb
selenium-webdriver-2.35.1 lib/selenium/webdriver/common/json_helper.rb
selenium-webdriver-2.35.0 lib/selenium/webdriver/common/json_helper.rb