Class: DWSRegistryWrapper

Inherits:
Object
  • Object
show all
Defined in:
lib/drb_reg_server.rb

Instance Method Summary collapse

Constructor Details

#initialize(filename) ⇒ DWSRegistryWrapper

Returns a new instance of DWSRegistryWrapper.



13
14
15
16
17
18
# File 'lib/drb_reg_server.rb', line 13

def initialize(filename)
  
  @filename = filename
  load_reg()
  
end

Instance Method Details

#delete_key(key) ⇒ Object



20
21
22
23
# File 'lib/drb_reg_server.rb', line 20

def delete_key(key)
  r = @reg.delete_key key
  r ? 'key deleted' : 'key not found'
end

#get_key(path, auto_detect_type: false) ⇒ Object



25
26
27
28
# File 'lib/drb_reg_server.rb', line 25

def get_key(path, auto_detect_type: false)
  e = @reg.get_key(path, auto_detect_type: auto_detect_type)
  e.xml
end

#get_keys(key) ⇒ Object



30
31
32
33
34
35
36
37
# File 'lib/drb_reg_server.rb', line 30

def get_keys(key)
  
  recordset = @reg.get_keys(key)
  return unless recordset
  
  recordset.to_doc(root: 'recordset').root.xml

end

#import(s) ⇒ Object



39
40
41
# File 'lib/drb_reg_server.rb', line 39

def import(s)
  @reg.import(s)    
end

#refreshObject



43
44
45
# File 'lib/drb_reg_server.rb', line 43

def refresh()
  load_reg()
end

#set_key(path, value) ⇒ Object



47
48
49
50
# File 'lib/drb_reg_server.rb', line 47

def set_key(path, value)
  e = @reg.set_key(path, value)
  e.xml
end

#xpath(xpath) ⇒ Object



52
53
54
55
56
57
58
59
# File 'lib/drb_reg_server.rb', line 52

def xpath(xpath)
  
  recordset = @reg.xpath(xpath)
  return unless recordset
  
  recordset.to_doc(root: 'recordset').root.xml          
  
end