Module: Fixtures::Numeric

Extended by:
Numeric
Includes:
Fixtures
Included in:
Numeric
Defined in:
lib/data_model/fixtures/numeric.rb

Overview

test fixtures for object type

Instance Method Summary collapse

Instance Method Details

#optionalExample

a numeric example that is optional

Returns:



27
28
29
# File 'lib/data_model/fixtures/numeric.rb', line 27

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

#simpleExample

a simple numeric example

Returns:



21
22
23
# File 'lib/data_model/fixtures/numeric.rb', line 21

def simple
	Example.new([:numeric], variants:)
end

#variantsObject



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

def variants
	{
		missing: nil,
		integer: 1,
		float: 1.0,
		decimal: 1.0.to_d,
		string: ["1", 1]
	}
end