End of Life Ruby 3.1 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
Win32::Registry#[]=
[]=(name, rtype, value = nil)
ext/win32/lib/win32/registry.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.1.3/ext/win32/lib/win32/registry.rb, line 777
def []=(name, rtype, value = nil)
if value
write name, rtype, value
else
case value = rtype
when Integer
write name, REG_DWORD, value
when String
write name, REG_SZ, value
when Array
write name, REG_MULTI_SZ, value
else
raise TypeError, "Unexpected type #{value.class}"
end
end
value
end
Write value to a registry value named name.
If wtype is specified, the value type is it. Otherwise, the value type is depend on class of value: :Integer
Example
REG_DWORD
:String
Example
REG_SZ
:Array
Example
REG_MULTI_SZ