Class: LocalStorage

Inherits:
Object
  • Object
show all
Defined in:
mrb_doc/platform_specific/web.rb

Instance Method Summary collapse

Instance Method Details

#get_item(key) ⇒ String

Returns the value stored in localStorage in the browser, if it doesn’t exist it will just return an empty string

Parameters:

  • key (String)

Returns:

  • (String)


17
18
19
20
21
# File 'mrb_doc/platform_specific/web.rb', line 17

def get_item(key)
  # mrb_local_storage_get_item
  # src/platform_specific/web.cpp
  'Hi!'
end

#set_item(key, value) ⇒ nil

Sets the value in localStorage in the browser

Parameters:

  • key (String)
  • value (String)

Returns:

  • (nil)


27
28
29
30
31
# File 'mrb_doc/platform_specific/web.rb', line 27

def set_item(key, value)
  # mrb_local_storage_set_item
  # src/platform_specific/web.cpp
  nil
end