might 0.7.5 → 0.7.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/might/filter_parameters.rb +12 -7
- data/lib/might/version.rb +1 -1
- metadata +6 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8be852d8aedf6a83afcc182c335f0c86ebefc45c160bc51f971be97a48e0f60b
|
4
|
+
data.tar.gz: f93ca06adca45d09f07650f7bbd64e8a591006bce298133b44a829620a519276
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 812bd7ad2365800528bd3f7c197988d0148923694cf59bfc628c27f1878f4820e148da674afd6069ca080d2f648c26aa84d5454c7ea7cc061d03fdbb169d2865
|
7
|
+
data.tar.gz: 5569a65ece876bdfeeadd3c08b94941f7e4a7ecb16b8ce7140c683dc5a3cc95e5f5d8033d76dd2dc5c4c1c54c812e845e2da86f5a34a724a0df5f7f21abd6726
|
@@ -29,21 +29,25 @@ module Might
|
|
29
29
|
|
30
30
|
# Find filter by name
|
31
31
|
# @param name [String]
|
32
|
+
# @param predicate [String]
|
32
33
|
# @return [Might::FilterParameter, nil]
|
33
34
|
#
|
34
|
-
def [](name)
|
35
|
-
parameters.detect
|
35
|
+
def [](name, predicate = nil)
|
36
|
+
parameters.detect do |filter|
|
37
|
+
filter.name == name && (predicate.nil? || filter.predicate == predicate)
|
38
|
+
end
|
36
39
|
end
|
37
40
|
|
38
41
|
# Find filter by name or raise error
|
39
42
|
# @param name [String]
|
43
|
+
# @param predicate [String]
|
40
44
|
# @yieldparam name [String]
|
41
45
|
# block value will be returned if no `FilterParameter` found with specified name
|
42
46
|
# @return [Might::FilterParameter]
|
43
47
|
# @raise FilterError
|
44
48
|
#
|
45
|
-
def fetch(name)
|
46
|
-
if (filter = self[name])
|
49
|
+
def fetch(name, predicate = nil)
|
50
|
+
if (filter = self[name, predicate])
|
47
51
|
filter
|
48
52
|
elsif block_given?
|
49
53
|
yield(name)
|
@@ -73,11 +77,12 @@ module Might
|
|
73
77
|
self.class.new(parameters.merge(other.parameters))
|
74
78
|
end
|
75
79
|
|
76
|
-
# Delete filter by name
|
80
|
+
# Delete filter by name and predicate
|
77
81
|
# @param name [String]
|
82
|
+
# @param predicate [String]
|
78
83
|
# @return [Might::FilterParameter, nil]
|
79
|
-
def delete(name)
|
80
|
-
filter_parameter = self[name]
|
84
|
+
def delete(name, predicate = nil)
|
85
|
+
filter_parameter = self[name, predicate]
|
81
86
|
parameters.delete(filter_parameter) if filter_parameter
|
82
87
|
filter_parameter
|
83
88
|
end
|
data/lib/might/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: might
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tema Bolshakov
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-10-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -258,7 +258,7 @@ homepage: https://github.com/SPBTV/might
|
|
258
258
|
licenses:
|
259
259
|
- Apache 2.0
|
260
260
|
metadata: {}
|
261
|
-
post_install_message:
|
261
|
+
post_install_message:
|
262
262
|
rdoc_options: []
|
263
263
|
require_paths:
|
264
264
|
- lib
|
@@ -273,9 +273,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
273
273
|
- !ruby/object:Gem::Version
|
274
274
|
version: '0'
|
275
275
|
requirements: []
|
276
|
-
|
277
|
-
|
278
|
-
signing_key:
|
276
|
+
rubygems_version: 3.0.3
|
277
|
+
signing_key:
|
279
278
|
specification_version: 4
|
280
279
|
summary: Mighty resource fetchers
|
281
280
|
test_files: []
|