servactory 2.0.0.rc2 → 2.0.0.rc4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/config/locales/en.yml +2 -1
- data/config/locales/ru.yml +2 -1
- data/lib/servactory/{methods/method.rb → actions/action.rb} +2 -2
- data/lib/servactory/{methods/aliases_for_make → actions/aliases}/collection.rb +2 -2
- data/lib/servactory/{methods/method_collection.rb → actions/collection.rb} +3 -3
- data/lib/servactory/{methods → actions}/dsl.rb +8 -8
- data/lib/servactory/{methods/shortcuts_for_make → actions/shortcuts}/collection.rb +2 -2
- data/lib/servactory/actions/stages/collection.rb +20 -0
- data/lib/servactory/actions/stages/stage.rb +30 -0
- data/lib/servactory/{methods → actions}/tools/runner.rb +1 -1
- data/lib/servactory/{methods → actions}/workspace.rb +2 -2
- data/lib/servactory/base.rb +1 -1
- data/lib/servactory/configuration/dsl.rb +2 -2
- data/lib/servactory/configuration/factory.rb +5 -5
- data/lib/servactory/configuration/setup.rb +4 -4
- data/lib/servactory/context/workspace/inputs.rb +7 -5
- data/lib/servactory/dsl.rb +1 -1
- data/lib/servactory/inputs/input.rb +3 -3
- data/lib/servactory/inputs/validations/base.rb +1 -1
- data/lib/servactory/inputs/validations/inclusion.rb +1 -1
- data/lib/servactory/inputs/validations/must.rb +2 -2
- data/lib/servactory/inputs/validations/required.rb +1 -1
- data/lib/servactory/inputs/validations/type.rb +13 -114
- data/lib/servactory/internals/internal.rb +3 -3
- data/lib/servactory/internals/validations/base.rb +1 -1
- data/lib/servactory/internals/validations/type.rb +6 -124
- data/lib/servactory/maintenance/attributes/option.rb +13 -7
- data/lib/servactory/maintenance/validations/collection.rb +66 -0
- data/lib/servactory/maintenance/validations/object_schema.rb +15 -18
- data/lib/servactory/maintenance/validations/types.rb +181 -0
- data/lib/servactory/outputs/output.rb +3 -3
- data/lib/servactory/outputs/validations/base.rb +1 -1
- data/lib/servactory/outputs/validations/type.rb +6 -124
- data/lib/servactory/version.rb +1 -1
- metadata +21 -19
- data/lib/servactory/methods/stage.rb +0 -28
- data/lib/servactory/methods/stage_collection.rb +0 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 83987eae2d3539d8eb196d0dd08d13ffee8449050d297794577933e8e5735e98
|
4
|
+
data.tar.gz: e35002ff20d061cc257c9e8ff99a8fd258f784ac19abce0d7c8f5c7a2c46f683
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 43268e0c7630e1eacd10efaf852eb0d26cbb5e30b4a4e5395202e67b4e9246dd2b92775da9318ced39cbd407aa714e4b89f151b6f2bc6164dab7bda722d84085
|
7
|
+
data.tar.gz: 999194eaeb288a7919d1177a46acac0ad35d07c039b7feb088140141ae9c34eb069cce39c5aaa22033bae0f9df7dc7981a8eb9c78bededfe0df540d97e7bb649
|
data/config/locales/en.yml
CHANGED
@@ -17,7 +17,8 @@ en:
|
|
17
17
|
type:
|
18
18
|
default_error:
|
19
19
|
default: "[%{service_class_name}] Wrong type of input `%{input_name}`, expected `%{expected_type}`, got `%{given_type}`"
|
20
|
-
for_collection:
|
20
|
+
for_collection:
|
21
|
+
wrong_element_type: "[%{service_class_name}] Wrong type in input collection `%{input_name}`, expected `%{expected_type}`, got `%{given_type}`"
|
21
22
|
for_hash:
|
22
23
|
wrong_element_type: "[%{service_class_name}] Wrong type in input hash `%{input_name}`, expected `%{expected_type}` for `%{key_name}`, got `%{given_type}`"
|
23
24
|
tools:
|
data/config/locales/ru.yml
CHANGED
@@ -17,7 +17,8 @@ ru:
|
|
17
17
|
type:
|
18
18
|
default_error:
|
19
19
|
default: "[%{service_class_name}] Неправильный тип инпута `%{input_name}`, ожидалось `%{expected_type}`, получено `%{given_type}`"
|
20
|
-
for_collection:
|
20
|
+
for_collection:
|
21
|
+
wrong_element_type: "[%{service_class_name}] Неправильный тип в коллекции инпута `%{input_name}`, ожидалось `%{expected_type}`, получено `%{given_type}`"
|
21
22
|
for_hash:
|
22
23
|
wrong_element_type: "[%{service_class_name}] Неправильный тип в хеше инпута `%{input_name}`, для `%{key_name}` ожидалось `%{expected_type}`, получено `%{given_type}`"
|
23
24
|
|
@@ -1,8 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module Servactory
|
4
|
-
module
|
5
|
-
class
|
4
|
+
module Actions
|
5
|
+
class Collection
|
6
6
|
extend Forwardable
|
7
7
|
def_delegators :@collection, :<<, :each, :sort_by
|
8
8
|
|
@@ -11,7 +11,7 @@ module Servactory
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def sorted_by_position
|
14
|
-
|
14
|
+
Collection.new(sort_by(&:position))
|
15
15
|
end
|
16
16
|
end
|
17
17
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module Servactory
|
4
|
-
module
|
4
|
+
module Actions
|
5
5
|
module DSL
|
6
6
|
def self.included(base)
|
7
7
|
base.extend(ClassMethods)
|
@@ -18,7 +18,7 @@ module Servactory
|
|
18
18
|
private
|
19
19
|
|
20
20
|
def stage(&block)
|
21
|
-
@current_stage = Stage.new(position: next_position)
|
21
|
+
@current_stage = Stages::Stage.new(position: next_position)
|
22
22
|
|
23
23
|
instance_eval(&block)
|
24
24
|
|
@@ -56,9 +56,9 @@ module Servactory
|
|
56
56
|
def make(name, position: nil, **options)
|
57
57
|
position = position.presence || next_position
|
58
58
|
|
59
|
-
current_stage = @current_stage.presence || Stage.new(position: position)
|
59
|
+
current_stage = @current_stage.presence || Stages::Stage.new(position: position)
|
60
60
|
|
61
|
-
current_stage.methods <<
|
61
|
+
current_stage.methods << Action.new(
|
62
62
|
name,
|
63
63
|
position: position,
|
64
64
|
**options
|
@@ -68,9 +68,9 @@ module Servactory
|
|
68
68
|
end
|
69
69
|
|
70
70
|
def method_missing(name, *args, &block)
|
71
|
-
return method_missing_for_aliases_for_make(name, *args, &block) if config.
|
71
|
+
return method_missing_for_aliases_for_make(name, *args, &block) if config.action_aliases.include?(name)
|
72
72
|
|
73
|
-
return method_missing_for_shortcuts_for_make(name, *args, &block) if config.
|
73
|
+
return method_missing_for_shortcuts_for_make(name, *args, &block) if config.action_shortcuts.include?(name)
|
74
74
|
|
75
75
|
super
|
76
76
|
end
|
@@ -93,7 +93,7 @@ module Servactory
|
|
93
93
|
end
|
94
94
|
|
95
95
|
def respond_to_missing?(name, *)
|
96
|
-
config.
|
96
|
+
config.action_aliases.include?(name) || config.action_shortcuts.include?(name) || super
|
97
97
|
end
|
98
98
|
|
99
99
|
def next_position
|
@@ -101,7 +101,7 @@ module Servactory
|
|
101
101
|
end
|
102
102
|
|
103
103
|
def collection_of_stages
|
104
|
-
@collection_of_stages ||=
|
104
|
+
@collection_of_stages ||= Stages::Collection.new
|
105
105
|
end
|
106
106
|
end
|
107
107
|
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Servactory
|
4
|
+
module Actions
|
5
|
+
module Stages
|
6
|
+
class Collection
|
7
|
+
extend Forwardable
|
8
|
+
def_delegators :@collection, :<<, :each, :merge, :sort_by, :size, :empty?
|
9
|
+
|
10
|
+
def initialize(collection = Set.new)
|
11
|
+
@collection = collection
|
12
|
+
end
|
13
|
+
|
14
|
+
def sorted_by_position
|
15
|
+
Collection.new(sort_by(&:position))
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Servactory
|
4
|
+
module Actions
|
5
|
+
module Stages
|
6
|
+
class Stage
|
7
|
+
attr_accessor :position,
|
8
|
+
:wrapper,
|
9
|
+
:rollback,
|
10
|
+
:condition,
|
11
|
+
:is_condition_opposite
|
12
|
+
|
13
|
+
def initialize(position:, wrapper: nil, rollback: nil, condition: nil)
|
14
|
+
@position = position
|
15
|
+
@wrapper = wrapper
|
16
|
+
@rollback = rollback
|
17
|
+
@condition = condition
|
18
|
+
end
|
19
|
+
|
20
|
+
def next_method_position
|
21
|
+
methods.size + 1
|
22
|
+
end
|
23
|
+
|
24
|
+
def methods
|
25
|
+
@methods ||= Collection.new
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -1,14 +1,14 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module Servactory
|
4
|
-
module
|
4
|
+
module Actions
|
5
5
|
module Workspace
|
6
6
|
private
|
7
7
|
|
8
8
|
def call!(collection_of_stages:, **)
|
9
9
|
super
|
10
10
|
|
11
|
-
Servactory::
|
11
|
+
Servactory::Actions::Tools::Runner.run!(self, collection_of_stages)
|
12
12
|
end
|
13
13
|
end
|
14
14
|
end
|
data/lib/servactory/base.rb
CHANGED
@@ -21,8 +21,8 @@ module Servactory
|
|
21
21
|
|
22
22
|
child.config.input_option_helpers = config.input_option_helpers
|
23
23
|
|
24
|
-
child.config.
|
25
|
-
child.config.
|
24
|
+
child.config.action_aliases = config.action_aliases
|
25
|
+
child.config.action_shortcuts = config.action_shortcuts
|
26
26
|
end
|
27
27
|
|
28
28
|
def config
|
@@ -28,19 +28,19 @@ module Servactory
|
|
28
28
|
end
|
29
29
|
|
30
30
|
def hash_mode_class_names(hash_mode_class_names)
|
31
|
-
@config.
|
31
|
+
@config.hash_mode_class_names.merge(hash_mode_class_names)
|
32
32
|
end
|
33
33
|
|
34
34
|
def input_option_helpers(input_option_helpers)
|
35
35
|
@config.input_option_helpers.merge(input_option_helpers)
|
36
36
|
end
|
37
37
|
|
38
|
-
def
|
39
|
-
@config.
|
38
|
+
def action_aliases(action_aliases)
|
39
|
+
@config.action_aliases.merge(action_aliases)
|
40
40
|
end
|
41
41
|
|
42
|
-
def
|
43
|
-
@config.
|
42
|
+
def action_shortcuts(action_shortcuts)
|
43
|
+
@config.action_shortcuts.merge(action_shortcuts)
|
44
44
|
end
|
45
45
|
end
|
46
46
|
end
|
@@ -10,8 +10,8 @@ module Servactory
|
|
10
10
|
:collection_mode_class_names,
|
11
11
|
:hash_mode_class_names,
|
12
12
|
:input_option_helpers,
|
13
|
-
:
|
14
|
-
:
|
13
|
+
:action_aliases,
|
14
|
+
:action_shortcuts
|
15
15
|
|
16
16
|
def initialize # rubocop:disable Metrics/MethodLength
|
17
17
|
@input_error_class = Servactory::Errors::InputError
|
@@ -29,8 +29,8 @@ module Servactory
|
|
29
29
|
@input_option_helpers =
|
30
30
|
Servactory::Maintenance::Attributes::OptionHelpersCollection.new(default_input_option_helpers)
|
31
31
|
|
32
|
-
@
|
33
|
-
@
|
32
|
+
@action_aliases = Servactory::Actions::Aliases::Collection.new
|
33
|
+
@action_shortcuts = Servactory::Actions::Shortcuts::Collection.new
|
34
34
|
end
|
35
35
|
|
36
36
|
private
|
@@ -48,7 +48,9 @@ module Servactory
|
|
48
48
|
|
49
49
|
input.value = input.default if input.optional? && input.value.blank?
|
50
50
|
|
51
|
-
|
51
|
+
if input.hash_mode?
|
52
|
+
input.value = prepare_hash_values_inside(object: input.value, schema: input.schema.fetch(:is))
|
53
|
+
end
|
52
54
|
|
53
55
|
input_prepare = input.prepare.fetch(:in, nil)
|
54
56
|
input.value = input_prepare.call(value: input.value) if input_prepare.present?
|
@@ -60,7 +62,7 @@ module Servactory
|
|
60
62
|
end
|
61
63
|
end
|
62
64
|
|
63
|
-
def
|
65
|
+
def prepare_hash_values_inside(object:, schema:) # rubocop:disable Metrics/MethodLength
|
64
66
|
return object unless object.respond_to?(:fetch)
|
65
67
|
|
66
68
|
schema.to_h do |schema_key, schema_value|
|
@@ -68,12 +70,12 @@ module Servactory
|
|
68
70
|
|
69
71
|
result =
|
70
72
|
if attribute_type == Hash
|
71
|
-
|
73
|
+
prepare_hash_values_inside(
|
72
74
|
object: object.fetch(schema_key, {}),
|
73
75
|
schema: schema_value.except(*RESERVED_ATTRIBUTES)
|
74
76
|
)
|
75
77
|
else
|
76
|
-
|
78
|
+
fetch_hash_values_from(
|
77
79
|
value: object.fetch(schema_key, {}),
|
78
80
|
schema_value: schema_value,
|
79
81
|
attribute_required: schema_value.fetch(:required, true)
|
@@ -84,7 +86,7 @@ module Servactory
|
|
84
86
|
end
|
85
87
|
end
|
86
88
|
|
87
|
-
def
|
89
|
+
def fetch_hash_values_from(value:, schema_value:, attribute_required:)
|
88
90
|
return value if attribute_required
|
89
91
|
return value if value.present?
|
90
92
|
|
data/lib/servactory/dsl.rb
CHANGED
@@ -68,7 +68,7 @@ module Servactory
|
|
68
68
|
add_types_option_with(type)
|
69
69
|
add_default_option_with(options)
|
70
70
|
add_collection_option_with(type, options)
|
71
|
-
|
71
|
+
add_hash_option_with(type, options)
|
72
72
|
|
73
73
|
# Check Class: Servactory::Inputs::Validations::Inclusion
|
74
74
|
add_inclusion_option_with(options)
|
@@ -161,7 +161,7 @@ module Servactory
|
|
161
161
|
)
|
162
162
|
end
|
163
163
|
|
164
|
-
def
|
164
|
+
def add_hash_option_with(type, options) # rubocop:disable Metrics/MethodLength
|
165
165
|
collection_of_options << Servactory::Maintenance::Attributes::Option.new(
|
166
166
|
name: :schema,
|
167
167
|
attribute: self,
|
@@ -178,8 +178,8 @@ module Servactory
|
|
178
178
|
)
|
179
179
|
],
|
180
180
|
need_for_checks: false,
|
181
|
+
body_key: :is,
|
181
182
|
body_fallback: {},
|
182
|
-
with_advanced_mode: false,
|
183
183
|
**options
|
184
184
|
)
|
185
185
|
end
|
@@ -75,7 +75,7 @@ module Servactory
|
|
75
75
|
|
76
76
|
def add_error_with(message, code)
|
77
77
|
add_error(
|
78
|
-
message,
|
78
|
+
message: message,
|
79
79
|
service_class_name: @context.class.name,
|
80
80
|
input: @input,
|
81
81
|
value: @input.value,
|
@@ -85,7 +85,7 @@ module Servactory
|
|
85
85
|
|
86
86
|
def add_syntax_error_with(message, code, exception_message)
|
87
87
|
add_error(
|
88
|
-
message,
|
88
|
+
message: message,
|
89
89
|
service_class_name: @context.class.name,
|
90
90
|
input: @input,
|
91
91
|
value: @input.value,
|
@@ -3,50 +3,11 @@
|
|
3
3
|
module Servactory
|
4
4
|
module Inputs
|
5
5
|
module Validations
|
6
|
-
class Type < Base
|
7
|
-
|
8
|
-
if input.collection_mode?
|
9
|
-
collection_message = input.consists_of.fetch(:message)
|
10
|
-
|
11
|
-
if collection_message.is_a?(Proc)
|
12
|
-
collection_message.call(input: input, expected_type: expected_type)
|
13
|
-
elsif collection_message.is_a?(String) && collection_message.present?
|
14
|
-
collection_message
|
15
|
-
else
|
16
|
-
I18n.t(
|
17
|
-
"servactory.inputs.checks.type.default_error.for_collection",
|
18
|
-
service_class_name: service_class_name,
|
19
|
-
input_name: input.name,
|
20
|
-
expected_type: expected_type,
|
21
|
-
given_type: given_type
|
22
|
-
)
|
23
|
-
end
|
24
|
-
elsif input.hash_mode? && key_name.present?
|
25
|
-
I18n.t(
|
26
|
-
"servactory.inputs.checks.type.default_error.for_hash.wrong_element_type",
|
27
|
-
service_class_name: service_class_name,
|
28
|
-
input_name: input.name,
|
29
|
-
key_name: key_name,
|
30
|
-
expected_type: expected_type,
|
31
|
-
given_type: given_type
|
32
|
-
)
|
33
|
-
else
|
34
|
-
I18n.t(
|
35
|
-
"servactory.inputs.checks.type.default_error.default",
|
36
|
-
service_class_name: service_class_name,
|
37
|
-
input_name: input.name,
|
38
|
-
expected_type: expected_type,
|
39
|
-
given_type: given_type
|
40
|
-
)
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
private_constant :DEFAULT_MESSAGE
|
45
|
-
|
46
|
-
def self.check(context:, input:, check_key:, check_options:)
|
6
|
+
class Type < Base
|
7
|
+
def self.check(context:, input:, check_key:, **)
|
47
8
|
return unless should_be_checked_for?(input, check_key)
|
48
9
|
|
49
|
-
new(context: context, input: input
|
10
|
+
new(context: context, input: input).check
|
50
11
|
end
|
51
12
|
|
52
13
|
def self.should_be_checked_for?(input, check_key)
|
@@ -59,62 +20,24 @@ module Servactory
|
|
59
20
|
)
|
60
21
|
end
|
61
22
|
|
62
|
-
|
63
|
-
|
64
|
-
def initialize(context:, input:, types:)
|
23
|
+
def initialize(context:, input:)
|
65
24
|
super()
|
66
25
|
|
67
26
|
@context = context
|
68
27
|
@input = input
|
69
|
-
@types = types
|
70
|
-
end
|
71
|
-
|
72
|
-
def check # rubocop:disable Metrics/MethodLength, Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
|
73
|
-
object_schema_validator = nil
|
74
|
-
|
75
|
-
return if prepared_types.any? do |type|
|
76
|
-
if @input.collection_mode?
|
77
|
-
prepared_value.is_a?(@types.fetch(0, Array)) &&
|
78
|
-
prepared_value.respond_to?(:all?) && prepared_value.all?(type)
|
79
|
-
elsif @input.hash_mode?
|
80
|
-
object_schema_validator = Servactory::Maintenance::Validations::ObjectSchema.validate(
|
81
|
-
object: prepared_value,
|
82
|
-
schema: @input.schema
|
83
|
-
)
|
84
|
-
|
85
|
-
object_schema_validator.valid?
|
86
|
-
else
|
87
|
-
prepared_value.is_a?(type)
|
88
|
-
end
|
89
|
-
end
|
90
|
-
|
91
|
-
if (first_error = object_schema_validator&.errors&.first).present?
|
92
|
-
return add_default_object_error_with(first_error)
|
93
|
-
end
|
94
|
-
|
95
|
-
add_default_error
|
96
28
|
end
|
97
29
|
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
end
|
30
|
+
def check
|
31
|
+
Servactory::Maintenance::Validations::Types.validate!(
|
32
|
+
context: @context,
|
33
|
+
attribute: @input,
|
34
|
+
types: @input.types,
|
35
|
+
value: prepared_value,
|
36
|
+
error_callback: ->(**args) { add_error(**args) }
|
37
|
+
)
|
107
38
|
end
|
108
39
|
|
109
|
-
|
110
|
-
types.map do |type|
|
111
|
-
if type.is_a?(String)
|
112
|
-
Object.const_get(type)
|
113
|
-
else
|
114
|
-
type
|
115
|
-
end
|
116
|
-
end
|
117
|
-
end
|
40
|
+
private
|
118
41
|
|
119
42
|
def prepared_value
|
120
43
|
@prepared_value ||= if @input.optional? && !@input.default.nil? && @input.value.blank?
|
@@ -123,30 +46,6 @@ module Servactory
|
|
123
46
|
@input.value
|
124
47
|
end
|
125
48
|
end
|
126
|
-
|
127
|
-
private
|
128
|
-
|
129
|
-
def add_default_object_error_with(error)
|
130
|
-
add_error(
|
131
|
-
DEFAULT_MESSAGE,
|
132
|
-
service_class_name: @context.class.name,
|
133
|
-
input: @input,
|
134
|
-
key_name: error.fetch(:name),
|
135
|
-
expected_type: error.fetch(:expected_type),
|
136
|
-
given_type: error.fetch(:given_type)
|
137
|
-
)
|
138
|
-
end
|
139
|
-
|
140
|
-
def add_default_error
|
141
|
-
add_error(
|
142
|
-
DEFAULT_MESSAGE,
|
143
|
-
service_class_name: @context.class.name,
|
144
|
-
input: @input,
|
145
|
-
key_name: nil,
|
146
|
-
expected_type: prepared_types.join(", "),
|
147
|
-
given_type: prepared_value.class.name
|
148
|
-
)
|
149
|
-
end
|
150
49
|
end
|
151
50
|
end
|
152
51
|
end
|
@@ -37,7 +37,7 @@ module Servactory
|
|
37
37
|
# Check Class: Servactory::Internals::Validations::Type
|
38
38
|
add_types_option_with(type)
|
39
39
|
add_collection_option_with(type, options)
|
40
|
-
|
40
|
+
add_hash_option_with(type, options)
|
41
41
|
end
|
42
42
|
|
43
43
|
def add_types_option_with(type)
|
@@ -71,7 +71,7 @@ module Servactory
|
|
71
71
|
)
|
72
72
|
end
|
73
73
|
|
74
|
-
def
|
74
|
+
def add_hash_option_with(type, options) # rubocop:disable Metrics/MethodLength
|
75
75
|
collection_of_options << Servactory::Maintenance::Attributes::Option.new(
|
76
76
|
name: :schema,
|
77
77
|
attribute: self,
|
@@ -83,8 +83,8 @@ module Servactory
|
|
83
83
|
)
|
84
84
|
],
|
85
85
|
need_for_checks: false,
|
86
|
+
body_key: :is,
|
86
87
|
body_fallback: {},
|
87
|
-
with_advanced_mode: false,
|
88
88
|
**options
|
89
89
|
)
|
90
90
|
end
|
@@ -6,7 +6,7 @@ module Servactory
|
|
6
6
|
class Base
|
7
7
|
protected
|
8
8
|
|
9
|
-
def raise_error_with(message
|
9
|
+
def raise_error_with(message:, **attributes)
|
10
10
|
message = message.call(**attributes) if message.is_a?(Proc)
|
11
11
|
|
12
12
|
raise @context.class.config.internal_error_class.new(message: message)
|