Class: Gizzard::MigratorConfig
- Inherits:
-
Object
- Object
- Gizzard::MigratorConfig
- Defined in:
- lib/gizzard/migrator.rb
Instance Attribute Summary collapse
-
#destination_type ⇒ Object
Returns the value of attribute destination_type.
-
#forwarding_space ⇒ Object
Returns the value of attribute forwarding_space.
-
#forwarding_space_min ⇒ Object
Returns the value of attribute forwarding_space_min.
-
#manifest ⇒ Object
Returns the value of attribute manifest.
-
#prefix ⇒ Object
Returns the value of attribute prefix.
-
#source_type ⇒ Object
Returns the value of attribute source_type.
-
#table_id ⇒ Object
Returns the value of attribute table_id.
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ MigratorConfig
constructor
A new instance of MigratorConfig.
- #shard_name(enum) ⇒ Object
Constructor Details
#initialize(opts = {}) ⇒ MigratorConfig
Returns a new instance of MigratorConfig.
5 6 7 |
# File 'lib/gizzard/migrator.rb', line 5 def initialize(opts = {}) opts.each {|(k,v)| send("#{k}=", v) if respond_to? "{k}=" } end |
Instance Attribute Details
#destination_type ⇒ Object
Returns the value of attribute destination_type.
3 4 5 |
# File 'lib/gizzard/migrator.rb', line 3 def destination_type @destination_type end |
#forwarding_space ⇒ Object
Returns the value of attribute forwarding_space.
3 4 5 |
# File 'lib/gizzard/migrator.rb', line 3 def forwarding_space @forwarding_space end |
#forwarding_space_min ⇒ Object
Returns the value of attribute forwarding_space_min.
3 4 5 |
# File 'lib/gizzard/migrator.rb', line 3 def forwarding_space_min @forwarding_space_min end |
#manifest ⇒ Object
Returns the value of attribute manifest.
3 4 5 |
# File 'lib/gizzard/migrator.rb', line 3 def manifest @manifest end |
#prefix ⇒ Object
Returns the value of attribute prefix.
3 4 5 |
# File 'lib/gizzard/migrator.rb', line 3 def prefix @prefix end |
#source_type ⇒ Object
Returns the value of attribute source_type.
3 4 5 |
# File 'lib/gizzard/migrator.rb', line 3 def source_type @source_type end |
#table_id ⇒ Object
Returns the value of attribute table_id.
3 4 5 |
# File 'lib/gizzard/migrator.rb', line 3 def table_id @table_id end |
Instance Method Details
#shard_name(enum) ⇒ Object
9 10 11 12 |
# File 'lib/gizzard/migrator.rb', line 9 def shard_name(enum) table_id_segment = (table_id && table_id < 0) ? "n#{table_id.abs}" : table_id [prefix, table_id, "%04d" % enum].compact.join("_") end |