Class: Cylons::RemoteRegistry
- Inherits:
-
Object
- Object
- Cylons::RemoteRegistry
- Defined in:
- lib/cylons/remote_registry.rb
Class Attribute Summary collapse
-
.loaded_remotes ⇒ Object
Returns the value of attribute loaded_remotes.
-
.remotes ⇒ Object
Returns the value of attribute remotes.
Class Method Summary collapse
- .clear_registry ⇒ Object
- .get_remote_schema(name) ⇒ Object
- .register(klass) ⇒ Object
- .register_remote_schema(klass) ⇒ Object
- .register_schemas ⇒ Object
- .remote_schema?(name) ⇒ Boolean
- .remote_schemas ⇒ Object
Class Attribute Details
.loaded_remotes ⇒ Object
Returns the value of attribute loaded_remotes.
11 12 13 |
# File 'lib/cylons/remote_registry.rb', line 11 def loaded_remotes @loaded_remotes end |
.remotes ⇒ Object
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_registry ⇒ Object
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_schemas ⇒ Object
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
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_schemas ⇒ Object
30 31 32 |
# File 'lib/cylons/remote_registry.rb', line 30 def self.remote_schemas ::DCell::Global.keys end |