type_struct 0.7.4 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.travis.yml +4 -4
- data/lib/type_struct.rb +3 -3
- data/lib/type_struct/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 8e9c0711f51f4b07350d1e6626ee95c5700bdcda3135ccc868aadd2f39339e03
|
4
|
+
data.tar.gz: 9d33ec7f4545520f3f8733124a785c8eb2eab9d935fc49835c66fc4ef2279507
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0819f9514d820b7de819f7df65aeca74d7e4b4d1222fb9c0161559493840ec1251ab91ce3950736cb302db2dec989f228ec9f0fc6e68765e0dfb258c1350e1f9'
|
7
|
+
data.tar.gz: 63b659f3188a6ab433308439812b0a0122a2ace07ee7b81162260fc8ddfaea75534b28f59682e388b1dd3a44ab72fc49ec01ce7cb62c83782c6888171d433e97
|
data/.travis.yml
CHANGED
data/lib/type_struct.rb
CHANGED
@@ -26,10 +26,10 @@ class TypeStruct
|
|
26
26
|
errors << e
|
27
27
|
end
|
28
28
|
end
|
29
|
-
instance_variable_set("@#{k}", sym_h[k])
|
30
29
|
sym_h[k].freeze if self.class.frozen?
|
31
30
|
end
|
32
31
|
raise MultiTypeError, errors unless errors.empty?
|
32
|
+
@__store = sym_h
|
33
33
|
end
|
34
34
|
|
35
35
|
def ==(other)
|
@@ -180,14 +180,14 @@ class TypeStruct
|
|
180
180
|
|
181
181
|
args.each_key do |k|
|
182
182
|
define_method(k) do
|
183
|
-
|
183
|
+
@__store[k]
|
184
184
|
end
|
185
185
|
|
186
186
|
define_method("#{k}=") do |v|
|
187
187
|
unless self.class.valid?(k, v)
|
188
188
|
raise TypeError, "#{self.class}##{k} expect #{self.class.type(k)} got #{v.inspect}"
|
189
189
|
end
|
190
|
-
|
190
|
+
@__store[k] = v
|
191
191
|
end
|
192
192
|
end
|
193
193
|
end
|
data/lib/type_struct/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: type_struct
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ksss
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-08-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -96,8 +96,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
96
96
|
- !ruby/object:Gem::Version
|
97
97
|
version: '0'
|
98
98
|
requirements: []
|
99
|
-
|
100
|
-
rubygems_version: 2.6.8
|
99
|
+
rubygems_version: 3.0.6
|
101
100
|
signing_key:
|
102
101
|
specification_version: 4
|
103
102
|
summary: Pseudo type system on struct.
|