Class: Selenium::WebDriver::HTML5::LocalStorage

Inherits:
Object
  • Object
show all
Includes:
SharedWebStorage
Defined in:
lib/selenium/webdriver/common/html5/local_storage.rb

Instance Method Summary collapse

Methods included from SharedWebStorage

#each, #empty?, #fetch, #key?

Constructor Details

#initialize(bridge) ⇒ LocalStorage

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of LocalStorage.



28
29
30
# File 'lib/selenium/webdriver/common/html5/local_storage.rb', line 28

def initialize(bridge)
  @bridge = bridge
end

Instance Method Details

#[](key) ⇒ Object



32
33
34
# File 'lib/selenium/webdriver/common/html5/local_storage.rb', line 32

def [](key)
  @bridge.getLocalStorageItem key
end

#[]=(key, value) ⇒ Object



36
37
38
# File 'lib/selenium/webdriver/common/html5/local_storage.rb', line 36

def []=(key, value)
  @bridge.setLocalStorageItem key, value
end

#clearObject



44
45
46
# File 'lib/selenium/webdriver/common/html5/local_storage.rb', line 44

def clear
  @bridge.clearLocalStorage
end

#delete(key) ⇒ Object



40
41
42
# File 'lib/selenium/webdriver/common/html5/local_storage.rb', line 40

def delete(key)
  @bridge.removeLocalStorageItem key
end

#keysObject



52
53
54
# File 'lib/selenium/webdriver/common/html5/local_storage.rb', line 52

def keys
  @bridge.getLocalStorageKeys.reverse
end

#sizeObject



48
49
50
# File 'lib/selenium/webdriver/common/html5/local_storage.rb', line 48

def size
  @bridge.getLocalStorageSize
end