Class: ActiveWarehouse::Builder::FixnumGenerator

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

Overview

Basic Fixnum generator

Instance Method Summary collapse

Instance Method Details

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

Generate an integer from 0 to options inclusive

Options:

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

  • :min: The minimum allowed value (default 0)



154
155
156
157
158
# File 'lib/active_warehouse/builder/random_data_builder.rb', line 154

def generate(column, options={})
  options[:max] ||= 1000
  options[:min] ||= 0
  rand(options[:max] + (-options[:min])) - options[:min]
end