Class: Switchman::DefaultShard
- Inherits:
-
Object
- Object
- Switchman::DefaultShard
- Defined in:
- lib/switchman/default_shard.rb
Class Method Summary collapse
Instance Method Summary collapse
- #_dump(depth) ⇒ Object
- #activate(*categories) ⇒ Object
- #activate!(*categories) ⇒ Object
- #database_server ⇒ Object
- #database_server_id ⇒ Object
- #default? ⇒ Boolean
- #description ⇒ Object
- #global_id_for(local_id) ⇒ Object
- #id ⇒ Object
- #name ⇒ Object
- #relative_id_for(local_id, target = nil) ⇒ Object
-
#shard ⇒ Object
The default’s shard is always the default shard.
Class Method Details
Instance Method Details
#_dump(depth) ⇒ Object
22 23 24 |
# File 'lib/switchman/default_shard.rb', line 22 def _dump(depth) '' end |
#activate(*categories) ⇒ Object
5 |
# File 'lib/switchman/default_shard.rb', line 5 def activate(*categories); yield; end |
#activate!(*categories) ⇒ Object
6 |
# File 'lib/switchman/default_shard.rb', line 6 def activate!(*categories); end |
#database_server ⇒ Object
11 |
# File 'lib/switchman/default_shard.rb', line 11 def database_server; ::Switchman::DatabaseServer.find(nil); end |
#database_server_id ⇒ Object
10 |
# File 'lib/switchman/default_shard.rb', line 10 def database_server_id; nil; end |
#default? ⇒ Boolean
7 |
# File 'lib/switchman/default_shard.rb', line 7 def default?; true; end |
#description ⇒ Object
19 |
# File 'lib/switchman/default_shard.rb', line 19 def description; Rails.env; end |
#global_id_for(local_id) ⇒ Object
9 |
# File 'lib/switchman/default_shard.rb', line 9 def global_id_for(local_id); local_id; end |
#id ⇒ Object
4 |
# File 'lib/switchman/default_shard.rb', line 4 def id; 'default'; end |
#name ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/switchman/default_shard.rb', line 12 def name unless instance_variable_defined?(:@name) @name = nil # prevent taking this branch on recursion @name = database_server.shard_name(:bootstrap) end @name end |
#relative_id_for(local_id, target = nil) ⇒ Object
8 |
# File 'lib/switchman/default_shard.rb', line 8 def relative_id_for(local_id, target = nil); local_id; end |
#shard ⇒ Object
The default’s shard is always the default shard
21 |
# File 'lib/switchman/default_shard.rb', line 21 def shard; self; end |