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.



30
31
32
# File 'lib/selenium/webdriver/common/html5/local_storage.rb', line 30

def initialize(bridge)
  @bridge = bridge
end

Instance Method Details

#[](key) ⇒ Object



34
35
36
# File 'lib/selenium/webdriver/common/html5/local_storage.rb', line 34

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

#[]=(key, value) ⇒ Object



38
39
40
# File 'lib/selenium/webdriver/common/html5/local_storage.rb', line 38

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

#clearObject



46
47
48
# File 'lib/selenium/webdriver/common/html5/local_storage.rb', line 46

def clear
  @bridge.clearLocalStorage
end

#delete(key) ⇒ Object



42
43
44
# File 'lib/selenium/webdriver/common/html5/local_storage.rb', line 42

def delete(key)
  @bridge.removeLocalStorageItem key
end

#keysObject



54
55
56
# File 'lib/selenium/webdriver/common/html5/local_storage.rb', line 54

def keys
  @bridge.getLocalStorageKeys.reverse
end

#sizeObject



50
51
52
# File 'lib/selenium/webdriver/common/html5/local_storage.rb', line 50

def size
  @bridge.getLocalStorageSize
end