Sha256: 652f52b1b632ae91d4751db835cfc5df8fe6a012e5e9163e94fd1203b2df84b0

Contents?: true

Size: 784 Bytes

Versions: 4

Compression:

Stored size: 784 Bytes

Contents

# typed: strict

require "bigdecimal/util"

module DataModel
	module Fixtures::BigDecimal
		include Fixtures
		extend T::Sig
		extend self

		sig { returns(Example) }
		def simple
			Example.new(
				[:decimal],
				variants: {
					valid: 5.to_d,
					missing: nil,
					string: ["5", 5.to_d]
				},
			)
		end

		sig { returns(Example) }
		def optional
			Example.new(
				[:decimal, { optional: true }],
				variants: {
					missing: nil
				},
			)
		end

		sig { returns(Example) }
		def min
			Example.new(
				[:decimal, { min: 5 }],
				variants: {
					bigger: 6.to_d,
					smaller: 4.to_d
				},
			)
		end

		sig { returns(Example) }
		def max
			Example.new(
				[:decimal, { max: 5 }],
				variants: {
					bigger: 6.to_d,
					smaller: 4.to_d
				},
			)
		end
	end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
data_model-0.4.0 lib/data_model/fixtures/big_decimal.rb
data_model-0.3.0 lib/data_model/fixtures/big_decimal.rb
data_model-0.2.0 lib/data_model/fixtures/big_decimal.rb
data_model-0.1.0 lib/data_model/fixtures/big_decimal.rb