Class: Selenium::WebDriver::HTML5::SessionStorage

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

Instance Method Summary collapse

Methods included from SharedWebStorage

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

Constructor Details

#initialize(bridge) ⇒ SessionStorage

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 SessionStorage.



37
38
39
# File 'lib/selenium/webdriver/common/html5/session_storage.rb', line 37

def initialize(bridge)
  @bridge = bridge
end

Instance Method Details

#[](key) ⇒ Object



9
10
11
# File 'lib/selenium/webdriver/common/html5/session_storage.rb', line 9

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

#[]=(key, value) ⇒ Object



13
14
15
# File 'lib/selenium/webdriver/common/html5/session_storage.rb', line 13

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

#clearObject



21
22
23
# File 'lib/selenium/webdriver/common/html5/session_storage.rb', line 21

def clear
  @bridge.clearSessionStorage
end

#delete(key) ⇒ Object



17
18
19
# File 'lib/selenium/webdriver/common/html5/session_storage.rb', line 17

def delete(key)
  @bridge.removeSessionStorageItem key
end

#keysObject



29
30
31
# File 'lib/selenium/webdriver/common/html5/session_storage.rb', line 29

def keys
  @bridge.getSessionStorageKeys.reverse
end

#sizeObject



25
26
27
# File 'lib/selenium/webdriver/common/html5/session_storage.rb', line 25

def size
  @bridge.getSessionStorageSize
end