Class: Dbee::Providers::ActiveRecordProvider::ObfuscatedAliasMaker

Inherits:
Object
  • Object
show all
Defined in:
lib/dbee/providers/active_record_provider/obfuscated_alias_maker.rb

Overview

Derives new alias names and keeps count of ones already generated in order to avoid collision.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(prefix = '') ⇒ ObfuscatedAliasMaker

Returns a new instance of ObfuscatedAliasMaker.



18
19
20
21
# File 'lib/dbee/providers/active_record_provider/obfuscated_alias_maker.rb', line 18

def initialize(prefix = '')
  @counter  = -1
  @prefix   = prefix
end

Instance Attribute Details

#prefixObject (readonly)

Returns the value of attribute prefix.



16
17
18
# File 'lib/dbee/providers/active_record_provider/obfuscated_alias_maker.rb', line 16

def prefix
  @prefix
end

Instance Method Details

#make(_name) ⇒ Object



23
24
25
26
# File 'lib/dbee/providers/active_record_provider/obfuscated_alias_maker.rb', line 23

def make(_name)
  increment
  current
end