Sha256: 3a04ebedecdb785530088e582350104ff1cdfdd56fbe9d465392a0858ad5d229

Contents?: true

Size: 335 Bytes

Versions: 1

Compression:

Stored size: 335 Bytes

Contents

module Fakeit
  module Openapi
    module Example
      BIG_NUM = 2**32

      def number_example
        Faker::Number.between(min_num, max_num).round(2)
      end

      private

      def min_num
        (minimum || 0).to_f.ceil(2)
      end

      def max_num
        (maximum || BIG_NUM).to_f.floor(2)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fakeit-0.1.2 lib/fakeit/openapi/example/number_example.rb