Class: Identifiable::Stylists::Alphanumeric

Inherits:
Object
  • Object
show all
Defined in:
lib/identifiable/stylists/alphanumeric.rb

Instance Method Summary collapse

Constructor Details

#initialize(record:) ⇒ Alphanumeric

Returns a new instance of Alphanumeric.



6
7
8
# File 'lib/identifiable/stylists/alphanumeric.rb', line 6

def initialize(record:)
  @record = record
end

Instance Method Details

#random_idObject



10
11
12
# File 'lib/identifiable/stylists/alphanumeric.rb', line 10

def random_id
  SecureRandom.alphanumeric(@record.class.identifiable_length)
end