Class: ActiveWarehouse::Builder::BigDecimalGenerator
- Inherits:
-
Object
- Object
- ActiveWarehouse::Builder::BigDecimalGenerator
- Defined in:
- lib/active_warehouse/builder/random_data_builder.rb
Overview
Basic BigDecimal generator
Instance Method Summary collapse
-
#generate(column, options = {}) ⇒ Object
Generate a big decimal from 0 to options inclusive (default 1000).
Instance Method Details
#generate(column, options = {}) ⇒ Object
Generate a big decimal from 0 to options inclusive (default 1000)
Options:
-
:max
: The maximum allowed value (default 1000)
179 180 181 182 |
# File 'lib/active_warehouse/builder/random_data_builder.rb', line 179 def generate(column, ={}) [:max] ||= 1000 BigDecimal.new((rand * [:max].to_f).to_s) # TODO: need BigDecimal type? end |