Class: Lhm::Migration
- Inherits:
-
Object
- Object
- Lhm::Migration
- Defined in:
- lib/lhm/migration.rb
Instance Attribute Summary collapse
-
#conditions ⇒ Object
readonly
Returns the value of attribute conditions.
-
#destination ⇒ Object
readonly
Returns the value of attribute destination.
-
#origin ⇒ Object
readonly
Returns the value of attribute origin.
-
#renames ⇒ Object
readonly
Returns the value of attribute renames.
Instance Method Summary collapse
- #archive_name ⇒ Object
-
#initialize(origin, destination, conditions = nil, renames = {}, time = Time.now) ⇒ Migration
constructor
A new instance of Migration.
- #intersection ⇒ Object
- #startstamp ⇒ Object
Constructor Details
#initialize(origin, destination, conditions = nil, renames = {}, time = Time.now) ⇒ 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, conditions = nil, renames = {}, time = Time.now) @origin = origin @destination = destination @conditions = conditions @start = time @renames = renames end |
Instance Attribute Details
#conditions ⇒ Object (readonly)
Returns the value of attribute conditions.
8 9 10 |
# File 'lib/lhm/migration.rb', line 8 def conditions @conditions end |
#destination ⇒ Object (readonly)
Returns the value of attribute destination.
8 9 10 |
# File 'lib/lhm/migration.rb', line 8 def destination @destination end |
#origin ⇒ Object (readonly)
Returns the value of attribute origin.
8 9 10 |
# File 'lib/lhm/migration.rb', line 8 def origin @origin end |
#renames ⇒ Object (readonly)
Returns the value of attribute renames.
8 9 10 |
# File 'lib/lhm/migration.rb', line 8 def renames @renames end |
Instance Method Details
#archive_name ⇒ Object
18 19 20 |
# File 'lib/lhm/migration.rb', line 18 def archive_name "lhma_#{ startstamp }_#{ @origin.name }"[0...64] end |
#intersection ⇒ Object
22 23 24 |
# File 'lib/lhm/migration.rb', line 22 def intersection Intersection.new(@origin, @destination, @renames) 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 |