Class: DirtySeed::Assigners::Number
- Defined in:
- lib/dirty_seed/assigners/number.rb
Overview
Draws an integer matching validators
Instance Attribute Summary collapse
-
#max ⇒ Object
readonly
Returns the value of attribute max.
-
#min ⇒ Object
readonly
Returns the value of attribute min.
Attributes inherited from Assigner
Instance Method Summary collapse
-
#value ⇒ Integer, Float
Returns an value matching all validators.
Methods inherited from Assigner
Constructor Details
This class inherits a constructor from DirtySeed::Assigners::Assigner
Instance Attribute Details
#max ⇒ Object (readonly)
Returns the value of attribute max.
7 8 9 |
# File 'lib/dirty_seed/assigners/number.rb', line 7 def max @max end |
#min ⇒ Object (readonly)
Returns the value of attribute min.
7 8 9 |
# File 'lib/dirty_seed/assigners/number.rb', line 7 def min @min end |
Instance Method Details
#value ⇒ Integer, Float
Returns an value matching all validators
11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/dirty_seed/assigners/number.rb', line 11 def value unless min && max define_min_and_max adjust_values end faker_value( category: :Number, method: :between, options: { from: min, to: max } ) end |