methodist 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/methodist/interactor.rb +3 -0
- data/lib/methodist/version.rb +1 -1
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fd9d4d0357dab78c599283f08c34ebf294e03490fec88ffc00df35405275b18b
|
4
|
+
data.tar.gz: db0104d27cce70ee074e0b753fcd892b6dcb9bb5e3f68e7cbecb79ebe44e3207
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 48c81ae406baac543b5ec5342b2bf2c63310b2a6abd6824160e9b2df6eaa8bf28641a3d6e07184d4763f73f77eca077d832b380cdfa044cc0a07ee004dff3768
|
7
|
+
data.tar.gz: 67cf6e03a315b28503f28f07818a596113465f7a83c0de17d7c535f5eef81d862ed31a0f14fcc99e0ddf91fed51aa5e194ab50cdbde4e83d36f5524f8c09ddb9
|
data/lib/methodist/interactor.rb
CHANGED
@@ -145,8 +145,10 @@ class Methodist::Interactor < Methodist::Pattern
|
|
145
145
|
def validate(input)
|
146
146
|
input = {} unless input
|
147
147
|
raise InputClassError, 'If you want to use custom #validate, you have to pass a hash to an interactor' unless input.is_a?(Hash)
|
148
|
+
|
148
149
|
validator = contract_class ? contract_class : input_schema
|
149
150
|
raise ValidatorDefinitionError, 'you must define schema via #schema OR define contract via #contract' unless validator
|
151
|
+
|
150
152
|
@validation_result = validator.call(input)
|
151
153
|
return Success(validation_result.to_h) if validation_result.success?
|
152
154
|
Failure(failure_validation_value)
|
@@ -178,4 +180,5 @@ class Methodist::Interactor < Methodist::Pattern
|
|
178
180
|
class InputClassError < StandardError; end
|
179
181
|
class DryValidationVersionError < StandardError; end
|
180
182
|
class ContractDefinitionError < StandardError; end
|
183
|
+
class SchemaDefinitionError < StandardError; end
|
181
184
|
end
|
data/lib/methodist/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: methodist
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sergey Nesterov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-12-
|
11
|
+
date: 2022-12-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -52,6 +52,20 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0.15'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rbs
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 2.8.2
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 2.8.2
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
70
|
name: sqlite3
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -170,7 +184,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
170
184
|
- !ruby/object:Gem::Version
|
171
185
|
version: '0'
|
172
186
|
requirements: []
|
173
|
-
rubygems_version: 3.
|
187
|
+
rubygems_version: 3.1.2
|
174
188
|
signing_key:
|
175
189
|
specification_version: 4
|
176
190
|
summary: Gem for Ruby on Rails created to stop chaos in your buisness logic.
|