Class: SlidingPartition::Definition
- Inherits:
-
Object
- Object
- SlidingPartition::Definition
- Defined in:
- lib/sliding_partition/definition.rb
Instance Attribute Summary collapse
-
#inherited_table_name ⇒ Object
Returns the value of attribute inherited_table_name.
-
#lead_time ⇒ Object
Returns the value of attribute lead_time.
-
#model ⇒ Object
readonly
Returns the value of attribute model.
-
#partition_interval ⇒ Object
Returns the value of attribute partition_interval.
-
#retention_interval ⇒ Object
Returns the value of attribute retention_interval.
-
#suffix ⇒ Object
Returns the value of attribute suffix.
-
#time_column ⇒ Object
Returns the value of attribute time_column.
Instance Method Summary collapse
- #final_copy!(at: Time.now, quiet: false) ⇒ Object
-
#initialize(model) {|_self| ... } ⇒ Definition
constructor
A new instance of Definition.
- #migrate!(at: Time.now, quiet: false) ⇒ Object
- #partitions(at: Time.now) ⇒ Object
- #rotate!(at: Time.now) ⇒ Object
- #setup!(at: Time.now) ⇒ Object
Constructor Details
#initialize(model) {|_self| ... } ⇒ Definition
Returns a new instance of Definition.
14 15 16 17 18 |
# File 'lib/sliding_partition/definition.rb', line 14 def initialize(model) @model = model set_defaults yield self if block_given? end |
Instance Attribute Details
#inherited_table_name ⇒ Object
Returns the value of attribute inherited_table_name.
10 11 12 |
# File 'lib/sliding_partition/definition.rb', line 10 def inherited_table_name @inherited_table_name end |
#lead_time ⇒ Object
Returns the value of attribute lead_time.
10 11 12 |
# File 'lib/sliding_partition/definition.rb', line 10 def lead_time @lead_time end |
#model ⇒ Object (readonly)
Returns the value of attribute model.
8 9 10 |
# File 'lib/sliding_partition/definition.rb', line 8 def model @model end |
#partition_interval ⇒ Object
Returns the value of attribute partition_interval.
10 11 12 |
# File 'lib/sliding_partition/definition.rb', line 10 def partition_interval @partition_interval end |
#retention_interval ⇒ Object
Returns the value of attribute retention_interval.
10 11 12 |
# File 'lib/sliding_partition/definition.rb', line 10 def retention_interval @retention_interval end |
#suffix ⇒ Object
Returns the value of attribute suffix.
10 11 12 |
# File 'lib/sliding_partition/definition.rb', line 10 def suffix @suffix end |
#time_column ⇒ Object
Returns the value of attribute time_column.
10 11 12 |
# File 'lib/sliding_partition/definition.rb', line 10 def time_column @time_column end |
Instance Method Details
#final_copy!(at: Time.now, quiet: false) ⇒ Object
36 37 38 |
# File 'lib/sliding_partition/definition.rb', line 36 def final_copy!(at: Time.now, quiet: false) PartitionDDLChanger.new(self, at, quiet: quiet).migrate! end |
#migrate!(at: Time.now, quiet: false) ⇒ Object
28 29 30 |
# File 'lib/sliding_partition/definition.rb', line 28 def migrate!(at: Time.now, quiet: false) PartitionDDLChanger.new(self, at, quiet: quiet).migrate! end |
#partitions(at: Time.now) ⇒ Object
32 33 34 |
# File 'lib/sliding_partition/definition.rb', line 32 def partitions(at: Time.now) TableCollection.new(definition: self, at_time: at) end |
#rotate!(at: Time.now) ⇒ Object
24 25 26 |
# File 'lib/sliding_partition/definition.rb', line 24 def rotate!(at: Time.now) PartitionDDLChanger.new(self, at).rotate! end |
#setup!(at: Time.now) ⇒ Object
20 21 22 |
# File 'lib/sliding_partition/definition.rb', line 20 def setup!(at: Time.now) PartitionDDLChanger.new(self, at).setup! end |