Module: ObfuscateId

Defined in:
lib/obfuscate_id.rb,
lib/obfuscate_id/version.rb

Defined Under Namespace

Modules: ClassMethods, InstanceMethods

Constant Summary collapse

VERSION =
"0.2.0"

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.hide(id, spin) ⇒ Object



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

def self.hide(id, spin)
  ScatterSwap.hash(id, spin)
end

.show(id, spin) ⇒ Object



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

def self.show(id, spin)
  ScatterSwap.reverse_hash(id, spin)
end

Instance Method Details

#obfuscate_id(options = {}) ⇒ Object



2
3
4
5
6
7
8
9
# File 'lib/obfuscate_id.rb', line 2

def obfuscate_id(options = {})
  require 'scatter_swap'

  extend ClassMethods 
  include InstanceMethods
  cattr_accessor :obfuscate_id_spin
  self.obfuscate_id_spin = (options[:spin] || obfuscate_id_default_spin)
end