typespec 0.1.0.5 → 0.1.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/typespec.rb +3 -3
- data/lib/typespec/gem.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ddfcf8dfafb5a8295b92253447cb43a9e83a6623
|
4
|
+
data.tar.gz: b71676b0515e45c7e0e7ee0a59aa022eea3ab84d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 595f9a3c3199868f4ebbfe55d0e3353b54edd5a5f37aa789fa1a2d456c39c59e8a1dc2fbc2d97a5a3ce32c17f9fe63fade4be69633b9c1337d447d85f07df4bd
|
7
|
+
data.tar.gz: 06be9dde73d6e75b8a855f590762c4d80d851939e71e4f62ff0ebccc5c15010d4e435680f7b11ba750f674b042709264609d4562df099216e333a9bd50f316a0
|
data/lib/typespec.rb
CHANGED
@@ -82,7 +82,7 @@ module Typespec
|
|
82
82
|
end
|
83
83
|
|
84
84
|
def valid?(value)
|
85
|
-
if value.is_a? Array
|
85
|
+
if value.is_a? ::Array
|
86
86
|
value.all?{|element| @element.valid?(element)}
|
87
87
|
else
|
88
88
|
false
|
@@ -105,7 +105,7 @@ module Typespec
|
|
105
105
|
end
|
106
106
|
|
107
107
|
def valid?(value)
|
108
|
-
if value.is_a? Hash
|
108
|
+
if value.is_a? ::Hash
|
109
109
|
value.all? do |k, v|
|
110
110
|
@pairs.any? do |pair|
|
111
111
|
pair.zip([k,v]).all? {|typespec, value| typespec.valid?(value)}
|
@@ -137,7 +137,7 @@ module Typespec
|
|
137
137
|
end
|
138
138
|
|
139
139
|
def valid?(struct, opts={})
|
140
|
-
if struct.instance_of? Object
|
140
|
+
if struct.instance_of? ::Object
|
141
141
|
ignore_if_not_in_spec = opts.fetch(:ignore_if_not_in_spec, false)
|
142
142
|
struct.instance_variables.all? do |property|
|
143
143
|
undecorated = property.to_s[1..-1].to_sym
|
data/lib/typespec/gem.rb
CHANGED