Class: Jylis::DataType::MVREG
- Defined in:
- lib/jylis-rb/data_types/mvreg.rb
Overview
A multi-value register.
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#get(key) ⇒ Object
Get the latest value(s) for the register at ‘key`.
-
#set(key, value) ⇒ Object
Set the latest ‘value` for the register at `key`.
Methods inherited from Base
Constructor Details
This class inherits a constructor from Jylis::DataType::Base
Instance Method Details
#get(key) ⇒ Object
Get the latest value(s) for the register at ‘key`.
9 10 11 |
# File 'lib/jylis-rb/data_types/mvreg.rb', line 9 def get(key) connection.query("MVREG", "GET", key) end |
#set(key, value) ⇒ Object
Set the latest ‘value` for the register at `key`.
14 15 16 17 18 19 20 |
# File 'lib/jylis-rb/data_types/mvreg.rb', line 14 def set(key, value) result = connection.query("MVREG", "SET", key, value) unless result == "OK" raise "Failed: MVREG SET #{key} #{value}" end end |