sequence-sdk 1.5.2 → 2.pre.rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,32 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Sequence
4
- # Module for validating options.
5
- # @private
6
- module Validations
7
- private
8
-
9
- def validate_required!(opts, *keys)
10
- if keys.all? { |k| opts[k].nil? || opts[k].empty? }
11
- list = keys.map { |k| ":#{k}" }.join(' and ')
12
- raise ArgumentError, "#{list} must be provided"
13
- end
14
- end
15
-
16
- def validate_either!(opts, *keys)
17
- if keys.all? { |k| opts[k].nil? || opts[k].empty? }
18
- list = keys.map { |k| ":#{k}" }.join(' or ')
19
- raise ArgumentError, "#{list} must be provided"
20
- end
21
- end
22
-
23
- def validate_inclusion_of!(opts, *valid)
24
- opts.each_key do |key|
25
- next if valid.include?(key)
26
- list = valid.map { |v| ":#{v}" }.join(', ')
27
- message = ":#{key} is an invalid option. Valid options are #{list}"
28
- raise ArgumentError, message
29
- end
30
- end
31
- end
32
- end