typero 0.8.0 → 0.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.version +1 -1
- data/lib/typero.rb +1 -0
- data/lib/typero/func.rb +14 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e1b145b43e7736b2c9f673b6685388a39ee83fcba0bbcbc0ad2fcf8af2c1f692
|
4
|
+
data.tar.gz: dd730a85ab31d2b181b875d7052e3b109a263caba0618d869e262e3004e6d52f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 86b7d2a84fccf9d800ae9c121773d3ae960b6f2c32100466836d6f07056ad2f2affa4fdbe8df8c91ea5cc208d7e006db993ddbce86c30b9652077b87f22cd4c5
|
7
|
+
data.tar.gz: 95a83f6b58874de8b27edb08811ea9543ebe7036550364d535f1a73042af90d77e36a891ccfcab9db36817572e6a400c203356cc54fb929358730bfc8425999e
|
data/.version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.8.
|
1
|
+
0.8.1
|
data/lib/typero.rb
CHANGED
data/lib/typero/func.rb
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
class Typero
|
2
|
+
SCHEMAS = {}
|
3
|
+
end
|
4
|
+
|
5
|
+
def Typero name=nil, &block
|
6
|
+
if block_given?
|
7
|
+
Typero.new(&block).tap do |schema|
|
8
|
+
Typero::SCHEMAS[name] = schema if name
|
9
|
+
end
|
10
|
+
else
|
11
|
+
raise ArgumentErorr.new('Schema nema not given') unless name
|
12
|
+
Typero::SCHEMAS[name] || raise(ArgumentErorr.new('Typero schema "%s" not defined' % name))
|
13
|
+
end
|
14
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: typero
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dino Reic
|
@@ -34,6 +34,7 @@ files:
|
|
34
34
|
- "./.version"
|
35
35
|
- "./lib/adapters/sequel.rb"
|
36
36
|
- "./lib/typero.rb"
|
37
|
+
- "./lib/typero/func.rb"
|
37
38
|
- "./lib/typero/params.rb"
|
38
39
|
- "./lib/typero/type/type.rb"
|
39
40
|
- "./lib/typero/type/types/boolean.rb"
|