Class: Lhm::TableName

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(original, time = Time.now) ⇒ TableName

Returns a new instance of TableName.



3
4
5
6
7
# File 'lib/lhm/table_name.rb', line 3

def initialize(original, time = Time.now)
  @original = original
  @time = time
  @timestamp = Timestamp.new(time)
end

Instance Attribute Details

#originalObject (readonly)

Returns the value of attribute original.



9
10
11
# File 'lib/lhm/table_name.rb', line 9

def original
  @original
end

Instance Method Details

#archivedObject



11
12
13
# File 'lib/lhm/table_name.rb', line 11

def archived
  "lhma_#{@timestamp}_#{@original}"[0...64]
end

#failedObject



15
16
17
# File 'lib/lhm/table_name.rb', line 15

def failed
  archived[0...57] + "_failed"
end

#newObject



19
20
21
# File 'lib/lhm/table_name.rb', line 19

def new
  "lhmn_#{@original}"[0...64]
end