Class: Lhm::Migration
- Inherits:
-
Object
- Object
- Lhm::Migration
- Defined in:
- lib/lhm/migration.rb
Instance Attribute Summary collapse
-
#destination ⇒ Object
readonly
Returns the value of attribute destination.
-
#insert_joins ⇒ Object
readonly
Returns the value of attribute insert_joins.
-
#origin ⇒ Object
readonly
Returns the value of attribute origin.
Instance Method Summary collapse
- #archive_name ⇒ Object
-
#initialize(origin, destination, time = Time.now, insert_trigger_additions, insert_joins) ⇒ Migration
constructor
A new instance of Migration.
- #intersection ⇒ Object
- #startstamp ⇒ Object
Constructor Details
#initialize(origin, destination, time = Time.now, insert_trigger_additions, insert_joins) ⇒ Migration
Returns a new instance of Migration.
10 11 12 13 14 15 16 |
# File 'lib/lhm/migration.rb', line 10 def initialize(origin, destination, time = Time.now, insert_trigger_additions, insert_joins) @origin = origin @destination = destination @start = time @insert_trigger_additions = insert_trigger_additions @insert_joins = insert_joins end |
Instance Attribute Details
#destination ⇒ Object (readonly)
Returns the value of attribute destination.
8 9 10 |
# File 'lib/lhm/migration.rb', line 8 def destination @destination end |
#insert_joins ⇒ Object (readonly)
Returns the value of attribute insert_joins.
8 9 10 |
# File 'lib/lhm/migration.rb', line 8 def insert_joins @insert_joins end |
#origin ⇒ Object (readonly)
Returns the value of attribute origin.
8 9 10 |
# File 'lib/lhm/migration.rb', line 8 def origin @origin end |
Instance Method Details
#archive_name ⇒ Object
18 19 20 |
# File 'lib/lhm/migration.rb', line 18 def archive_name "lhma_#{ startstamp }_#{ @origin.name }" end |
#intersection ⇒ Object
22 23 24 |
# File 'lib/lhm/migration.rb', line 22 def intersection Intersection.new(@origin, @destination, @insert_trigger_additions) end |
#startstamp ⇒ Object
26 27 28 |
# File 'lib/lhm/migration.rb', line 26 def startstamp @start.strftime "%Y_%m_%d_%H_%M_%S_#{ "%03d" % (@start.usec / 1000) }" end |