Class: Identifiable::Stylists::Alphanumeric
- Inherits:
-
Object
- Object
- Identifiable::Stylists::Alphanumeric
- Defined in:
- lib/identifiable/stylists/alphanumeric.rb
Instance Method Summary collapse
-
#initialize(record:) ⇒ Alphanumeric
constructor
A new instance of Alphanumeric.
- #random_id ⇒ Object
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_id ⇒ Object
10 11 12 |
# File 'lib/identifiable/stylists/alphanumeric.rb', line 10 def random_id SecureRandom.alphanumeric(@record.class.identifiable_length) end |