class DataAnon::Strategy::Field::RandomFloat

Generates random float number between given two numbers. Default range is 0.0 to 100.0

!!!ruby
anonymize('points').using FieldStrategy::RandomFloat.new(3.0,5.0)

Public Class Methods

new(from = 0.0, to = 100.0) click to toggle source
# File lib/strategy/field/number/random_float.rb, line 12
def initialize from = 0.0, to = 100.0
  @from = from
  @to = to

end

Public Instance Methods

anonymize(field) click to toggle source
# File lib/strategy/field/number/random_float.rb, line 18
def anonymize field
  DataAnon::Utils::RandomFloat.generate(@from,@to)
end