Module: Fixtures::Array

Extended by:
Array, T::Sig
Includes:
Fixtures
Included in:
Array
Defined in:
lib/data_model/fixtures/array.rb

Instance Method Summary collapse

Instance Method Details

#array_optional_stringObject



51
52
53
54
55
56
57
58
59
# File 'lib/data_model/fixtures/array.rb', line 51

def array_optional_string
	Example.new(
		[:array, [:string, { optional: true }]],
		variants: {
			optional_strings: ["a", nil, "c"],
			numbers: [1, nil, 3]
		},
	)
end

#optional_string_arrayObject



40
41
42
43
44
45
46
47
48
# File 'lib/data_model/fixtures/array.rb', line 40

def optional_string_array
	Example.new(
		[:array, { optional: true }, :string],
		variants: {
			strings: ["a", "b", "c"],
			missing: nil
		},
	)
end

#string_arrayObject



10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/data_model/fixtures/array.rb', line 10

def string_array
	Example.new(
		[:array, :string],
		variants: {
			strings: ["a", "b", "c"],
			string: ["a", ["a"]],
			number: [1, ["1"]],
			missing: nil,
			numbers: [[1, 2, 3], ["1", "2", "3"]],
			other_type: Object.new
		},
	)
end

#wrapping_string_arrayObject



25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/data_model/fixtures/array.rb', line 25

def wrapping_string_array
	Example.new(
		[:array, { wrap_single_value: true }, :string],
		variants: {
			strings: ["a", "b", "c"],
			string: ["a", ["a"]],
			number: [1, ["1"]],
			missing: nil,
			numbers: [[1, 2, 3], ["1", "2", "3"]],
			other_type: Object.new
		},
	)
end