Environment configuration
Dependent on Ruby1.9.3 or later.
Installation steps
Install RubyGems.
Run
gem install dalli
. (Make sure to use version 2.7.3 or later. Otherwise, there will be authentication failures.)
Code example
require 'dalli'
options = { :username => ‘username', :password => ‘password' } #"username" indicates the instance ID in "Instance details" of " Basic information" on the console, while "password" indicates the password set through the "Changing password" function.
dc = Dalli::Client.new('ip:port', options) #"ip" indicates the Intranet address in "Instance details" of "Basic information" on the console, while "port" indicates the port number in "Instance details" of "Basic information".
dc.set('key', ‘value')
value = dc.get(‘key')