Class: Immudb::RootService

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

Instance Method Summary collapse

Constructor Details

#initializeRootService

Returns a new instance of RootService.



15
16
17
18
19
# File 'lib/immudb/root_service.rb', line 15

def initialize
  @dbname = nil
  @cache = nil
  @service = nil
end

Instance Method Details

#getObject



28
29
30
# File 'lib/immudb/root_service.rb', line 28

def get
  @cache ||= @service.current_state(Google::Protobuf::Empty.new)
end

#init(dbname, service) ⇒ Object



21
22
23
24
25
26
# File 'lib/immudb/root_service.rb', line 21

def init(dbname, service)
  @dbname = dbname
  @service = service
  state = @service.current_state(Google::Protobuf::Empty.new)
  @cache = state
end

#set(root) ⇒ Object



32
33
34
# File 'lib/immudb/root_service.rb', line 32

def set(root)
  @cache = root
end