typ 0.0.2 → 0.0.3
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/lib/typ.rb +10 -21
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e49bb76b04240c1b96f1b20b1eb5cc2fce4168ee0b730e3b768ff3787b3d8e98
|
4
|
+
data.tar.gz: c4425deabbbb4fa53346ceb33b0697cc88b5b7094114f8549f9ea5fd222363e2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e6cea78fa037f0d53208139274c39871da6431c338c20399f9af93928ab12812397963b602e2fd05d4999edc0295b431239243798ba09684f3547dfcf0a7bc67
|
7
|
+
data.tar.gz: d1c39f5d629a4b9b0a90e3aebc23f8c1bea7d713670463d0d5acd1a0a52a1e00997306da275c4a8ff623e02b9c1baa41d037fab63287063ff4d4b8f28b125da4
|
data/lib/typ.rb
CHANGED
@@ -37,21 +37,6 @@ module Typ
|
|
37
37
|
end
|
38
38
|
|
39
39
|
module Is
|
40
|
-
def self.included gate
|
41
|
-
gate.extend Singleton
|
42
|
-
end
|
43
|
-
|
44
|
-
module Singleton
|
45
|
-
attr_accessor :check
|
46
|
-
end
|
47
|
-
|
48
|
-
def initialize object
|
49
|
-
@ok = self.class.check[object]
|
50
|
-
end
|
51
|
-
|
52
|
-
def ok?
|
53
|
-
@ok
|
54
|
-
end
|
55
40
|
|
56
41
|
module Array
|
57
42
|
class << self
|
@@ -67,12 +52,8 @@ module Typ
|
|
67
52
|
end
|
68
53
|
|
69
54
|
gate = Class.new
|
70
|
-
|
71
|
-
gate.include Is
|
72
|
-
gate.check = check
|
73
|
-
|
74
55
|
gate.include self
|
75
|
-
gate.array = array
|
56
|
+
gate.check, gate.array = check, array
|
76
57
|
gate
|
77
58
|
end
|
78
59
|
end
|
@@ -82,12 +63,20 @@ module Typ
|
|
82
63
|
end
|
83
64
|
|
84
65
|
module Singleton
|
85
|
-
attr_accessor :array
|
66
|
+
attr_accessor :check, :array
|
86
67
|
end
|
87
68
|
|
88
69
|
def to_a
|
89
70
|
self.class.array
|
90
71
|
end
|
72
|
+
|
73
|
+
def ok?
|
74
|
+
@ok
|
75
|
+
end
|
76
|
+
|
77
|
+
def initialize it
|
78
|
+
@ok = self.class.check[it]
|
79
|
+
end
|
91
80
|
end
|
92
81
|
end
|
93
82
|
end
|