Class: Dynamo::Record::TaskHelpers::Scale
- Inherits:
-
Object
- Object
- Dynamo::Record::TaskHelpers::Scale
- Defined in:
- lib/dynamo/record/task_helpers/scale.rb
Instance Attribute Summary collapse
-
#attribute_selector ⇒ Object
readonly
Returns the value of attribute attribute_selector.
-
#existing_throughput ⇒ Object
readonly
Returns the value of attribute existing_throughput.
-
#migration ⇒ Object
readonly
Returns the value of attribute migration.
-
#model ⇒ Object
readonly
Returns the value of attribute model.
-
#model_name ⇒ Object
readonly
Returns the value of attribute model_name.
-
#new_throughput ⇒ Object
readonly
Returns the value of attribute new_throughput.
Instance Method Summary collapse
-
#initialize(model_name, attribute_selector, new_throughput) ⇒ Scale
constructor
A new instance of Scale.
- #run ⇒ Object
Constructor Details
#initialize(model_name, attribute_selector, new_throughput) ⇒ Scale
Returns a new instance of Scale.
8 9 10 11 12 |
# File 'lib/dynamo/record/task_helpers/scale.rb', line 8 def initialize(model_name, attribute_selector, new_throughput) @model_name = model_name @attribute_selector = attribute_selector @new_throughput = new_throughput end |
Instance Attribute Details
#attribute_selector ⇒ Object (readonly)
Returns the value of attribute attribute_selector.
5 6 7 |
# File 'lib/dynamo/record/task_helpers/scale.rb', line 5 def attribute_selector @attribute_selector end |
#existing_throughput ⇒ Object (readonly)
Returns the value of attribute existing_throughput.
6 7 8 |
# File 'lib/dynamo/record/task_helpers/scale.rb', line 6 def existing_throughput @existing_throughput end |
#migration ⇒ Object (readonly)
Returns the value of attribute migration.
6 7 8 |
# File 'lib/dynamo/record/task_helpers/scale.rb', line 6 def migration @migration end |
#model ⇒ Object (readonly)
Returns the value of attribute model.
5 6 7 |
# File 'lib/dynamo/record/task_helpers/scale.rb', line 5 def model @model end |
#model_name ⇒ Object (readonly)
Returns the value of attribute model_name.
6 7 8 |
# File 'lib/dynamo/record/task_helpers/scale.rb', line 6 def model_name @model_name end |
#new_throughput ⇒ Object (readonly)
Returns the value of attribute new_throughput.
5 6 7 |
# File 'lib/dynamo/record/task_helpers/scale.rb', line 5 def new_throughput @new_throughput end |
Instance Method Details
#run ⇒ Object
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/dynamo/record/task_helpers/scale.rb', line 14 def run return description if [model_name, attribute_selector, new_throughput].any?(&:nil?) @model = model_name.constantize @migration = Aws::Record::TableMigration.new(model) @existing_throughput = model.provisioned_throughput update_throughput end |