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.
Instance Method Summary collapse
- #archive_name ⇒ Object
-
#initialize(origin, destination, conditions = nil, time = Time.now) ⇒ Migration
constructor
A new instance of Migration.
- #intersection ⇒ Object
- #startstamp ⇒ Object
Constructor Details
#initialize(origin, destination, conditions = nil, time = Time.now) ⇒ Migration
10 11 12 13 14 15 |
# File 'lib/lhm/migration.rb', line 10 def initialize(origin, destination, conditions = nil, time = Time.now) @origin = origin @destination = destination @conditions = conditions @start = time 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 |
Instance Method Details
#archive_name ⇒ Object
17 18 19 |
# File 'lib/lhm/migration.rb', line 17 def archive_name "lhma_#{ startstamp }_#{ @origin.name }"[0...64] end |
#intersection ⇒ Object
21 22 23 |
# File 'lib/lhm/migration.rb', line 21 def intersection Intersection.new(@origin, @destination) end |
#startstamp ⇒ Object
25 26 27 |
# File 'lib/lhm/migration.rb', line 25 def startstamp @start.strftime "%Y_%m_%d_%H_%M_%S_#{ "%03d" % (@start.usec / 1000) }" end |