Class: Identifiable::Stylists::Numeric
- Inherits:
-
Object
- Object
- Identifiable::Stylists::Numeric
- Defined in:
- lib/identifiable/stylists/numeric.rb
Instance Method Summary collapse
-
#initialize(record:) ⇒ Numeric
constructor
A new instance of Numeric.
- #random_id ⇒ Object
Constructor Details
#initialize(record:) ⇒ Numeric
Returns a new instance of Numeric.
6 7 8 9 |
# File 'lib/identifiable/stylists/numeric.rb', line 6 def initialize(record:) @record = record @scale = scale end |
Instance Method Details
#random_id ⇒ Object
11 12 13 |
# File 'lib/identifiable/stylists/numeric.rb', line 11 def random_id (SecureRandom.random_number(@scale.max - @scale.min) + @scale.min).to_s end |