checkability 1.0.0 → 1.0.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f427c18e28549b00de27a9b29d5c3278be27a07f76b5efeb3c88bd07c9fa8004
4
- data.tar.gz: 68c2e5ca988d593452a15b07c2b0a9f6155cf4a170434c40509c2e8f570a1cff
3
+ metadata.gz: 49569c239e2acdb43486cf8269a923d3118424798700e49be0edfaf7f7551b25
4
+ data.tar.gz: 7a81f73bc65865564495bd5d8b9680d76249fa69b3d730543162ebd5b1f61048
5
5
  SHA512:
6
- metadata.gz: 6f86d27e1c09d25597de9a6f82701aba4ebfe77c29c469857c1cb2b07d492e87485a9f234c957083220df84f03d66d991b1e700a7aa4121782e567a8be9a3cb2
7
- data.tar.gz: d52836824181062c8e294b56e27d3b6d486b5860d6f13be64d2fe6cefd6c9e98f22d3980a1d35d5ebde74374f3df3c89a4be8bf1b2feb7be4f69ff750c23713c
6
+ metadata.gz: d28be27a0487566262cf3d284213b076f1c7dbc9bfc2f59844444fa16761842c9348dd9df609420488bc8d597a3b50741a7bb712de86ab2056afb565399dc07b
7
+ data.tar.gz: ad42af8d0f399d130c2282d4c2938230f87c9f01e70fd43df3f031303aeca8767335a5e0fabe281b58edb1d081c5500a10a83d94e7befda7f461f4770bbf9c0c
@@ -24,6 +24,8 @@ module Checkability
24
24
  #
25
25
  # validator.handle(request)
26
26
  #
27
+ # ChainOfResponsibilty
28
+ #
27
29
  def check(handler_confs)
28
30
  first_handler_name = handler_confs.keys.first
29
31
  first_handler = _handlers(handler_confs)[first_handler_name]
@@ -38,11 +40,11 @@ module Checkability
38
40
 
39
41
  def _handlers(handler_confs)
40
42
  handlers = _make_handlers(handler_confs)
41
-
42
- handlers.each do |handler_name, handler|
43
- next_handler_name = handler_confs[handler_name][:next_handler]
43
+ handlers.each_value.with_index do |handler, i|
44
+ next_handler_name = handlers.keys[i + 1]
44
45
  handler.next_handler(handlers[next_handler_name]) if handlers[next_handler_name]
45
46
  end
47
+ handlers
46
48
  end
47
49
 
48
50
  def _make_handlers(confs)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Checkability
4
- VERSION = '1.0.0'
4
+ VERSION = '1.0.1'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: checkability
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrey Eremeev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-04-05 00:00:00.000000000 Z
11
+ date: 2021-04-06 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Provide Checkers functionality.
14
14
  email: