Sha256: 1b2dbc7d01e3565ba7cb7c744c07429f9b3845d9f0061e5f520e5c507eabe7b8

Contents?: true

Size: 486 Bytes

Versions: 15

Compression:

Stored size: 486 Bytes

Contents

module DCell
  # Global object registry shared among all DCell nodes
  module Global
    extend self

    # Get a global value
    def get(key)
      DCell.registry.get_global key.to_s
    end
    alias_method :[], :get

    # Set a global value
    def set(key, value)
      DCell.registry.set_global key.to_s, value
    end
    alias_method :[]=, :set

    # Get the keys for all the globals in the system
    def keys
      DCell.registry.global_keys.map(&:to_sym)
    end
  end
end

Version data entries

15 entries across 15 versions & 2 rubygems

Version Path
dcell-0.16.1 lib/dcell/global.rb
stn-dcell-0.16.0 lib/dcell/global.rb
dcell-0.16.0 lib/dcell/global.rb
dcell-0.16.0.pre lib/dcell/global.rb
dcell-0.15.0 lib/dcell/global.rb
dcell-0.15.0.pre lib/dcell/global.rb
dcell-0.14.0 lib/dcell/global.rb
dcell-0.13.0 lib/dcell/global.rb
dcell-0.13.0.pre lib/dcell/global.rb
dcell-0.12.0.pre lib/dcell/global.rb
dcell-0.10.0 lib/dcell/global.rb
dcell-0.9.0 lib/dcell/global.rb
dcell-0.8.0 lib/dcell/global.rb
dcell-0.7.1 lib/dcell/global.rb
dcell-0.0.1 lib/dcell/global.rb