Sha256: 58f2f527c64b69578b7ac120eed24f128fc223421dc8ea682c832feee918c0a3

Contents?: true

Size: 794 Bytes

Versions: 66

Compression:

Stored size: 794 Bytes

Contents

module Selenium
  module WebDriver
    module HTML5

      module SharedWebStorage
        include Enumerable

        def key?(key)
          keys.include? key
        end
        alias_method :member?, :key?
        alias_method :has_key?, :key?

        def fetch(key, &blk)
          if self.key? key
            return self[key]
          end

          if block_given?
            yield key
          else
            # should be KeyError, but it's 1.9-specific
            raise IndexError, "missing key #{key.inspect}" 
          end
        end

        def empty?
          size == 0
        end

        def each(&blk)
          return enum_for(:each) unless block_given?

          keys.each do |k|
            yield k, self[k]
          end
        end
      end

    end
  end
end

Version data entries

66 entries across 66 versions & 4 rubygems

Version Path
selenium-webdriver-2.45.0 lib/selenium/webdriver/common/html5/shared_web_storage.rb
selenium-webdriver-2.45.0.dev3 lib/selenium/webdriver/common/html5/shared_web_storage.rb
selenium-webdriver-2.45.0.dev2 lib/selenium/webdriver/common/html5/shared_web_storage.rb
selenium-webdriver-2.45.0.dev lib/selenium/webdriver/common/html5/shared_web_storage.rb
selenium-webdriver-2.44.0 lib/selenium/webdriver/common/html5/shared_web_storage.rb
selenium-webdriver-2.44.0.dev lib/selenium/webdriver/common/html5/shared_web_storage.rb
selenium-webdriver-2.43.0 lib/selenium/webdriver/common/html5/shared_web_storage.rb
selenium-webdriver-2.42.0 lib/selenium/webdriver/common/html5/shared_web_storage.rb
selenium-webdriver-2.41.0 lib/selenium/webdriver/common/html5/shared_web_storage.rb
browserstack-webdriver-2.40.1 lib/selenium/webdriver/common/html5/shared_web_storage.rb
selenium-webdriver-2.40.0 lib/selenium/webdriver/common/html5/shared_web_storage.rb
selenium-webdriver-2.40.0.rc2 lib/selenium/webdriver/common/html5/shared_web_storage.rb
selenium-webdriver-2.40.0.rc1 lib/selenium/webdriver/common/html5/shared_web_storage.rb
selenium-webdriver-2.39.0 lib/selenium/webdriver/common/html5/shared_web_storage.rb
selenium-webdriver-2.38.0 lib/selenium/webdriver/common/html5/shared_web_storage.rb
browserstack-webdriver-0.0.22 lib/selenium/webdriver/common/html5/shared_web_storage.rb
browserstack-webdriver-0.0.1 lib/selenium/webdriver/common/html5/shared_web_storage.rb
selenium-webdriver-2.37.0 lib/selenium/webdriver/common/html5/shared_web_storage.rb
selenium-webdriver-2.35.1 lib/selenium/webdriver/common/html5/shared_web_storage.rb
selenium-webdriver-2.35.0 lib/selenium/webdriver/common/html5/shared_web_storage.rb