servactory 2.0.3 → 2.0.4
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1f3edad8d15393a6541eee430383fcd03da3ddf339bf6215ddf95d391487dde6
|
4
|
+
data.tar.gz: 7143c15722e8d1183f523126dbf265315f182588b193f233a6f140612c532af0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0f2f96d3707a5ea5787a837e90e4c3a45ccf0464499525259e357d918ea6173b3e4318ff1f3fc70841f04bfbc2971e2f66fd378bdaf733d82e0237b5dff242ad
|
7
|
+
data.tar.gz: 5aae275ca976e9a4b5d3db1bec44e2a9bcfac18ef53c7b6e6fbd15a874d89970d066073eea09369d80bacc0ce81d6a6190883178d58c92b9965def62f3be809f
|
@@ -7,8 +7,9 @@ module Servactory
|
|
7
7
|
RESERVED_ATTRIBUTES = %i[type required default].freeze
|
8
8
|
private_constant :RESERVED_ATTRIBUTES
|
9
9
|
|
10
|
-
def initialize(context:, collection_of_inputs:)
|
10
|
+
def initialize(context:, incoming_arguments:, collection_of_inputs:)
|
11
11
|
@context = context
|
12
|
+
@incoming_arguments = incoming_arguments
|
12
13
|
@collection_of_inputs = collection_of_inputs
|
13
14
|
end
|
14
15
|
|
@@ -47,19 +48,20 @@ module Servactory
|
|
47
48
|
|
48
49
|
return yield if input.nil?
|
49
50
|
|
50
|
-
|
51
|
+
input_value = @incoming_arguments.fetch(input.name, nil)
|
52
|
+
input_value = input.default if input.optional? && input_value.blank?
|
51
53
|
|
52
54
|
if input.hash_mode? && (tmp_schema = input.schema.fetch(:is)).present?
|
53
|
-
|
55
|
+
input_value = prepare_hash_values_inside(object: input_value, schema: tmp_schema)
|
54
56
|
end
|
55
57
|
|
56
58
|
input_prepare = input.prepare.fetch(:in, nil)
|
57
|
-
|
59
|
+
input_value = input_prepare.call(value: input_value) if input_prepare.present?
|
58
60
|
|
59
61
|
if name.to_s.end_with?("?")
|
60
|
-
Servactory::Utils.query_attribute(
|
62
|
+
Servactory::Utils.query_attribute(input_value)
|
61
63
|
else
|
62
|
-
|
64
|
+
input_value
|
63
65
|
end
|
64
66
|
end
|
65
67
|
# rubocop:enable Metrics/MethodLength, Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity, Lint/UnusedMethodArgument
|
data/lib/servactory/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: servactory
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anton Sokolov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-12-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -319,7 +319,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
319
319
|
- !ruby/object:Gem::Version
|
320
320
|
version: '0'
|
321
321
|
requirements: []
|
322
|
-
rubygems_version: 3.
|
322
|
+
rubygems_version: 3.5.1
|
323
323
|
signing_key:
|
324
324
|
specification_version: 4
|
325
325
|
summary: A set of tools for building reliable services of any complexity
|