bbk-app 1.1.0.199675 → 1.1.0.200186
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/bbk/app/domains/by_block.rb +23 -0
- data/lib/bbk/app/domains_set.rb +37 -0
- data/lib/bbk/app.rb +1 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0015bff7294750f2619f091dcd78733a7d57f7b8cce1cbf5f30740b387cd31de
|
4
|
+
data.tar.gz: 326e8891cc26e15c2f7264305edc7488444d9d1e0e5350a14d5fc6ebfa1b43e7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9b51c79011c934f623e631dc9a361f45010e52aee8ffa65f06a8d80705cda9769dc1d3f6448ee84ad17bc0caad68720f8103f8cce1b3a2d87dfc415b3603708c
|
7
|
+
data.tar.gz: b36a555638e1055f96bd9d5996b935c014d1f3d2050c4dccba8a5c3633cbae8f8ba252e64e6189141db8cb38a2de5c63021a19812e7c662c2674ffced62f9938
|
data/Gemfile.lock
CHANGED
@@ -0,0 +1,23 @@
|
|
1
|
+
module BBK
|
2
|
+
module App
|
3
|
+
module Domains
|
4
|
+
class ByBlock
|
5
|
+
|
6
|
+
attr_reader :name
|
7
|
+
|
8
|
+
def initialize(name, &block)
|
9
|
+
raise ArgumentError.new('no block') unless block_given?
|
10
|
+
|
11
|
+
@name = name
|
12
|
+
@block = block
|
13
|
+
end
|
14
|
+
|
15
|
+
def call(route)
|
16
|
+
@block.call(route)
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
@@ -0,0 +1,37 @@
|
|
1
|
+
require 'bbk/app/domains/by_block'
|
2
|
+
|
3
|
+
module BBK
|
4
|
+
module App
|
5
|
+
class DomainsSet
|
6
|
+
def initialize(*domains)
|
7
|
+
@domains = domains.map{|d| [d.name.to_s, d] }.to_h
|
8
|
+
end
|
9
|
+
|
10
|
+
# Get exchange name by domain
|
11
|
+
# @param domain_name [String] domain name
|
12
|
+
# @return [String] exchange name configured for passed domain name
|
13
|
+
def [](domain_name)
|
14
|
+
@domains[domain_name]
|
15
|
+
end
|
16
|
+
|
17
|
+
def add(domain)
|
18
|
+
@domains[domain.name.to_s] = domain
|
19
|
+
end
|
20
|
+
|
21
|
+
alias << add
|
22
|
+
|
23
|
+
# Each method implementation for object iteration
|
24
|
+
def each(&block)
|
25
|
+
@domains.values.each(&block)
|
26
|
+
end
|
27
|
+
|
28
|
+
# Check if store has information about domain
|
29
|
+
# @param domain_name [String] domain name
|
30
|
+
# @return [Boolean] has information about domain
|
31
|
+
def has?(domain_name)
|
32
|
+
@domains.key? domain_name
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
data/lib/bbk/app.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bbk-app
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.0.
|
4
|
+
version: 1.1.0.200186
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samoilenko Yuri
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-12-
|
11
|
+
date: 2023-12-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -267,6 +267,8 @@ files:
|
|
267
267
|
- lib/bbk/app/dispatcher/queue_stream_strategy.rb
|
268
268
|
- lib/bbk/app/dispatcher/result.rb
|
269
269
|
- lib/bbk/app/dispatcher/route.rb
|
270
|
+
- lib/bbk/app/domains/by_block.rb
|
271
|
+
- lib/bbk/app/domains_set.rb
|
270
272
|
- lib/bbk/app/factory.rb
|
271
273
|
- lib/bbk/app/handler.rb
|
272
274
|
- lib/bbk/app/matchers.rb
|