Class: Identifiable::Stylists::Numeric

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

Instance Method Summary collapse

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_idObject



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