constrain 0.1.1 → 0.1.2
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 +4 -4
- data/README.md +5 -4
- data/lib/constrain.rb +1 -1
- data/lib/constrain/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bc16332a51e4f45dabe31a86b2e21bfeed6f54f11310c026609184c0cd28b577
|
4
|
+
data.tar.gz: 3f88e7f7c97fb7dd925191274d89366729e53b4e5fba2f2628b197f4f7bb6664
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 06fb09ab023fe14278efd1adda85af85c4b1649cc78923d56ffbd0e5634c9508931e22b762c8a305b369ef0d0de56d04223b6fbada6649a19e7558002c313090
|
7
|
+
data.tar.gz: 156bed0099e954c53c4cad966c2a55731b49639058748bda9de01fbf1ff8348a6c7a0b0b2723e569e2d578319bb6fd0b6ad1aa5b23afa7334f609410b55cdb4f
|
data/README.md
CHANGED
@@ -84,12 +84,13 @@ or false as result
|
|
84
84
|
## Class Expressions
|
85
85
|
|
86
86
|
Constrain#constrain and Constrain::check use class expressions composed of
|
87
|
-
|
88
|
-
objects match if
|
87
|
+
class or module objects, Proc objects, or arrays and hashes of class expressions. Class or module
|
88
|
+
objects match if `value.is_a?(class_or_module)` returns true:
|
89
89
|
|
90
90
|
```ruby
|
91
|
-
constrain 42, Integer
|
92
|
-
constrain 42,
|
91
|
+
constrain 42, Integer # Success
|
92
|
+
constrain 42, Comparable # Success
|
93
|
+
constrain nil, Comparable # Failure
|
93
94
|
```
|
94
95
|
|
95
96
|
More than one class expression is allowed. It matches if at least one of the expressions match:
|
data/lib/constrain.rb
CHANGED
data/lib/constrain/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: constrain
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Claus Rasmussen
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-05-
|
11
|
+
date: 2021-05-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: simplecov
|