Module: DCell::Global

Extended by:
Global
Included in:
Global
Defined in:
lib/dcell/global.rb

Overview

Global object registry shared among all DCell nodes

Instance Method Summary collapse

Instance Method Details

#get(key) ⇒ Object Also known as: []

Get a global value



7
8
9
# File 'lib/dcell/global.rb', line 7

def get(key)
  DCell.registry.get_global key.to_s
end

#keysObject

Get the keys for all the globals in the system



19
20
21
# File 'lib/dcell/global.rb', line 19

def keys
  DCell.registry.global_keys.map(&:to_sym)
end

#set(key, value) ⇒ Object Also known as: []=

Set a global value



13
14
15
# File 'lib/dcell/global.rb', line 13

def set(key, value)
  DCell.registry.set_global key.to_s, value
end