Class: ActiveWarehouse::Builder::FloatGenerator

Inherits:
Object
  • Object
show all
Defined in:
lib/active_warehouse/builder/random_data_builder.rb

Overview

Basic Float generator

Instance Method Summary collapse

Instance Method Details

#generate(column, options = {}) ⇒ Object

Generate a float from 0 to options inclusive (default 1000)

Options:

  • :max: The maximum allowed value (default 1000)



167
168
169
170
# File 'lib/active_warehouse/builder/random_data_builder.rb', line 167

def generate(column, options={})
  options[:max] ||= 1000
  rand * options[:max].to_f
end