Class: Cylons::RemoteRegistry

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

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.loaded_remotesObject

Returns the value of attribute loaded_remotes.



11
12
13
# File 'lib/cylons/remote_registry.rb', line 11

def loaded_remotes
  @loaded_remotes
end

.remotesObject

Returns the value of attribute remotes.



11
12
13
# File 'lib/cylons/remote_registry.rb', line 11

def remotes
  @remotes
end

Class Method Details

.clear_registryObject



14
15
16
# File 'lib/cylons/remote_registry.rb', line 14

def self.clear_registry
  ::DCell.registry.instance_variable_get("@global_registry").clear
end

.get_remote_schema(name) ⇒ Object



42
43
44
# File 'lib/cylons/remote_registry.rb', line 42

def self.get_remote_schema(name)
  ::DCell::Global["#{name}_schema".to_sym]
end

.register(klass) ⇒ Object



18
19
20
21
# File 'lib/cylons/remote_registry.rb', line 18

def self.register(klass)
  ::Cylons::Connection.connect unless ::Cylons::Connection.connected?
  @remotes << klass
end

.register_remote_schema(klass) ⇒ Object



34
35
36
# File 'lib/cylons/remote_registry.rb', line 34

def self.register_remote_schema(klass)
  ::DCell::Global["#{klass.name.downcase}_schema".to_sym] = ::Cylons::RemoteSchema.new(klass)
end

.register_schemasObject



23
24
25
26
27
28
# File 'lib/cylons/remote_registry.rb', line 23

def self.register_schemas
  @remotes.each do |remote|
    ::Cylons.logger.info remote
    register_remote_schema(remote)
  end
end

.remote_schema?(name) ⇒ Boolean

Returns:

  • (Boolean)


38
39
40
# File 'lib/cylons/remote_registry.rb', line 38

def self.remote_schema?(name)
  ::DCell::Global.keys.include? "#{name}_schema".to_sym
end

.remote_schemasObject



30
31
32
# File 'lib/cylons/remote_registry.rb', line 30

def self.remote_schemas
  ::DCell::Global.keys
end