Class: ActiveWarehouse::Builder::FixnumGenerator
- Inherits:
-
Object
- Object
- ActiveWarehouse::Builder::FixnumGenerator
- Defined in:
- lib/active_warehouse/builder/random_data_builder.rb
Overview
Basic Fixnum generator
Instance Method Summary collapse
-
#generate(column, options = {}) ⇒ Object
Generate an integer from 0 to options inclusive.
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, ={}) [:max] ||= 1000 [:min] ||= 0 rand([:max] + (-[:min])) - [:min] end |