Module: Fixtures::Float

Extended by:
Float
Includes:
Fixtures
Included in:
Float
Defined in:
lib/data_model/fixtures/float.rb

Overview

Test data for float schemas

Instance Method Summary collapse

Instance Method Details

#maxExample

a float example where the maximum value is 5

Returns:



45
46
47
48
49
50
51
52
53
# File 'lib/data_model/fixtures/float.rb', line 45

def max
	Example.new(
		[:float, { max: 5.0 }],
		variants: {
			bigger: 6.0,
			smaller: 4.0
		},
	)
end

#minExample

a float example where the minimum value is 5

Returns:



33
34
35
36
37
38
39
40
41
# File 'lib/data_model/fixtures/float.rb', line 33

def min
	Example.new(
		[:float, { min: 5 }],
		variants: {
			bigger: 6.0,
			smaller: 4.0
		},
	)
end

#optionalExample

a float example that is optional

Returns:



22
23
24
25
26
27
28
29
# File 'lib/data_model/fixtures/float.rb', line 22

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

#simpleExample

a simple float example

Returns:



9
10
11
12
13
14
15
16
17
18
# File 'lib/data_model/fixtures/float.rb', line 9

def simple
	Example.new(
		[:float],
		variants: {
			valid: 5.0,
			missing: nil,
			string: ["5", 5.0]
		},
	)
end