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

Inherits:
Object
  • Object
show all
Includes:
SharedWebStorage
Defined in:
rb/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.



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

def initialize(bridge)
  @bridge = bridge
end

Instance Method Details

#[](key) ⇒ Object



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

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

#[]=(key, value) ⇒ Object



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

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

#clearObject



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

def clear
  @bridge.clear_local_storage
end

#delete(key) ⇒ Object



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

def delete(key)
  @bridge.remove_local_storage_item key
end

#keysObject



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

def keys
  @bridge.local_storage_keys.reverse
end

#sizeObject



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

def size
  @bridge.local_storage_size
end