fried-typings 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/lib/fried/typings/anything.rb +16 -0
- data/lib/fried/typings/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7866dae7ccc98fe2459b1c589b6731e491bcdc12
|
4
|
+
data.tar.gz: 54280c938aac3ca6e3cdbbfc31613450ae6cb163
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2b9a162718f2300d13cf0d8abda402cfaab9ef2cda8dd966794a733aacee7dfb98a61edad5a93f819b4039cdc6857efa49e2a8542fee8b7cd17dc080809d46c2
|
7
|
+
data.tar.gz: 643720bb41085d55d5383244202dd6fea77e8f60fe6e1fefc13adfd34b0c881cdf629348bcc801cf6c07c45fa1f234f8c10282f2614527f3ca3788e43fe5140f
|
data/README.md
CHANGED
@@ -69,6 +69,7 @@ one_of.(ArgumentError.new) # => false
|
|
69
69
|
**any** of the types
|
70
70
|
- `StrictlyOneOf[type1, type2, ...typeN]` checks that object pass
|
71
71
|
`IsStrictly[typeN]` for **any** of the types
|
72
|
+
- `Anything` matches any object
|
72
73
|
- `Boolean` checks that object is either `true` or `false`
|
73
74
|
- `ArrayOf[type]` checks that all element of the array pass `Is[type]`
|
74
75
|
- `HashOf[key_type, value_type]` checks that all pairs of hash pass
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require "forwardable"
|
2
|
+
require "fried/core"
|
3
|
+
require "fried/typings/type"
|
4
|
+
|
5
|
+
module Fried::Typings
|
6
|
+
# Matches any object
|
7
|
+
anything = Class.new do
|
8
|
+
include Type
|
9
|
+
|
10
|
+
# @param obj any object
|
11
|
+
def valid?(obj)
|
12
|
+
true
|
13
|
+
end
|
14
|
+
end
|
15
|
+
Anything = anything.new
|
16
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fried-typings
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Fire-Dragon-DoL
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-11-
|
11
|
+
date: 2017-11-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -139,6 +139,7 @@ files:
|
|
139
139
|
- bin/setup
|
140
140
|
- fried-typings.gemspec
|
141
141
|
- lib/fried/typings.rb
|
142
|
+
- lib/fried/typings/anything.rb
|
142
143
|
- lib/fried/typings/array_of.rb
|
143
144
|
- lib/fried/typings/boolean.rb
|
144
145
|
- lib/fried/typings/enumerator_of.rb
|