Class: Lhm::Migration

Inherits:
Object
  • Object
show all
Defined in:
lib/lhm/migration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#conditionsObject (readonly)

Returns the value of attribute conditions.



8
9
10
# File 'lib/lhm/migration.rb', line 8

def conditions
  @conditions
end

#destinationObject (readonly)

Returns the value of attribute destination.



8
9
10
# File 'lib/lhm/migration.rb', line 8

def destination
  @destination
end

#originObject (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_nameObject



17
18
19
# File 'lib/lhm/migration.rb', line 17

def archive_name
  "lhma_#{ startstamp }_#{ @origin.name }"[0...64]
end

#intersectionObject



21
22
23
# File 'lib/lhm/migration.rb', line 21

def intersection
  Intersection.new(@origin, @destination)
end

#startstampObject



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