Module: Fixtures::Or

Extended by:
Or
Includes:
Fixtures
Included in:
Or
Defined in:
lib/data_model/fixtures/or.rb

Overview

test fixtures for object type

Instance Method Summary collapse

Instance Method Details

#optionalExample

a numeric example that is optional

Returns:



25
26
27
# File 'lib/data_model/fixtures/or.rb', line 25

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

#simpleExample

a simple numeric example, integer or integer array

Returns:



19
20
21
# File 'lib/data_model/fixtures/or.rb', line 19

def simple
	Example.new([:or, :integer, [:array, :integer]], variants:)
end

#variantsObject



7
8
9
10
11
12
13
14
15
# File 'lib/data_model/fixtures/or.rb', line 7

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