fried-typings 0.1.0 → 0.2.0

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
  SHA1:
3
- metadata.gz: 86853d9a07622e785db2dabbc2071db3715e0ff0
4
- data.tar.gz: 63e0a1de55ef8e02517fc0fd886f3da14a9cf75c
3
+ metadata.gz: 7866dae7ccc98fe2459b1c589b6731e491bcdc12
4
+ data.tar.gz: 54280c938aac3ca6e3cdbbfc31613450ae6cb163
5
5
  SHA512:
6
- metadata.gz: a6ebdffc3ddb599eb4830eae30de020cfae619ecfb8b20f0949702f6f6477a9bee0e63946b3b8b6b7b7a1bf2567514c06753906a4f5a88b2825f7c87bfc69ad3
7
- data.tar.gz: 0a2cb1311a314d58bb3e9f9ea6eb1bd6f0ac3a47a9239d0c11fa6a376c5e2a9528d0b7d09391790dffc11ac4f5870d92fcb9368a6ed74a5674b562e048544457
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
@@ -1,5 +1,5 @@
1
1
  module Fried
2
2
  module Typings
3
- VERSION = "0.1.0"
3
+ VERSION = "0.2.0"
4
4
  end
5
5
  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.1.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-20 00:00:00.000000000 Z
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