typestrict 0.0.15 → 0.0.16
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.
- data/History.txt +7 -0
- data/lib/base.rb +12 -11
- data/lib/typestrict.rb +1 -1
- metadata +4 -4
data/History.txt
CHANGED
data/lib/base.rb
CHANGED
@@ -164,6 +164,18 @@ module Strict
|
|
164
164
|
return map
|
165
165
|
end
|
166
166
|
|
167
|
+
def enforce_map_defaults!(matrix, map)
|
168
|
+
enforce_primitive!(Hash, matrix, "lib/typestrict")
|
169
|
+
enforce_primitive!(Hash, map, "lib/typestrict")
|
170
|
+
|
171
|
+
matrix.each do |param, default_value|
|
172
|
+
if !map.has_key? param
|
173
|
+
map[param] = default_value
|
174
|
+
end
|
175
|
+
end
|
176
|
+
return map
|
177
|
+
end
|
178
|
+
|
167
179
|
def enforce_map_optional!(matrix, map)
|
168
180
|
enforce_primitive!(Hash, matrix, "lib/typestrict")
|
169
181
|
enforce_primitive!(Hash, map, "lib/typestrict")
|
@@ -179,16 +191,5 @@ module Strict
|
|
179
191
|
setmode_raise!
|
180
192
|
return map
|
181
193
|
end
|
182
|
-
|
183
|
-
def enforce_defaults!(matrix, map)
|
184
|
-
enforce_primitive!(Hash, matrix, "lib/typestrict")
|
185
|
-
enforce_primitive!(Hash, map, "lib/typestrict")
|
186
|
-
|
187
|
-
matrix.each do |param, default|
|
188
|
-
if !map.has_key? param
|
189
|
-
map[param] = default
|
190
|
-
end
|
191
|
-
end
|
192
|
-
end
|
193
194
|
end
|
194
195
|
end
|
data/lib/typestrict.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: typestrict
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 63
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 16
|
10
|
+
version: 0.0.16
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Raeez Lorgat
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-08-
|
18
|
+
date: 2010-08-20 00:00:00 -07:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|