Class: Apicraft::Mocker::Number
- Defined in:
- lib/apicraft/mocker/number.rb
Overview
Generate fake values for numbers
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
Constructor Details
This class inherits a constructor from Apicraft::Mocker::Base
Instance Method Details
#mock ⇒ Object
7 8 9 10 11 12 13 14 |
# File 'lib/apicraft/mocker/number.rb', line 7 def mock return enum.sample if enum.present? Faker::Number.between( from: schema.minimum || 1, to: schema.maximum || 100 ) * multiple_of end |