Class: Gizzard::Transformation::Op::RepairShards
- Defined in:
- lib/gizzard/transformation_op.rb
Instance Attribute Summary collapse
-
#from ⇒ Object
readonly
Returns the value of attribute from.
-
#to ⇒ Object
(also: #template)
readonly
Returns the value of attribute to.
Instance Method Summary collapse
- #apply(nameserver, table_id, base_id, table_prefix, translations) ⇒ Object
- #expand(*args) ⇒ Object
-
#initialize(*shards) ⇒ RepairShards
constructor
A new instance of RepairShards.
- #involved_shards(table_prefix, translations) ⇒ Object
Methods inherited from BaseOp
#<=>, #eql?, #inspect, #inverse?
Constructor Details
#initialize(*shards) ⇒ RepairShards
Returns a new instance of RepairShards.
55 56 57 |
# File 'lib/gizzard/transformation_op.rb', line 55 def initialize(*shards) @shards = shards end |
Instance Attribute Details
#from ⇒ Object (readonly)
Returns the value of attribute from.
52 53 54 |
# File 'lib/gizzard/transformation_op.rb', line 52 def from @from end |
#to ⇒ Object (readonly) Also known as: template
Returns the value of attribute to.
52 53 54 |
# File 'lib/gizzard/transformation_op.rb', line 52 def to @to end |
Instance Method Details
#apply(nameserver, table_id, base_id, table_prefix, translations) ⇒ Object
65 66 67 |
# File 'lib/gizzard/transformation_op.rb', line 65 def apply(nameserver, table_id, base_id, table_prefix, translations) nameserver.repair_shards(involved_shards(table_prefix, translations)) end |
#expand(*args) ⇒ Object
59 |
# File 'lib/gizzard/transformation_op.rb', line 59 def (*args); { :repair => [self] } end |
#involved_shards(table_prefix, translations) ⇒ Object
61 62 63 |
# File 'lib/gizzard/transformation_op.rb', line 61 def involved_shards(table_prefix, translations) shards.map{|s| s.to_shard_id(table_prefix, translations)} end |