Sha256: 0cad2ab11238edbd35d5726a830b9bcb2c4b02309013ac77d499a18c4e8b7c6d

Contents?: true

Size: 671 Bytes

Versions: 2

Compression:

Stored size: 671 Bytes

Contents

# Copyright (c) 2011 - 2013, SoundCloud Ltd., Rany Keddo, Tobias Bielohlawek, Tobias
# Schmidt

require 'lhm/intersection'

module Lhm
  class Migration
    attr_reader :origin, :destination, :conditions

    def initialize(origin, destination, conditions = nil, time = Time.now)
      @origin = origin
      @destination = destination
      @conditions = conditions
      @start = time
    end

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

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

    def startstamp
      @start.strftime "%Y_%m_%d_%H_%M_%S_#{ "%03d" % (@start.usec / 1000) }"
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
lhm-2.1.0 lib/lhm/migration.rb
lhm-2.0.0 lib/lhm/migration.rb