typespec 0.1.0.7 → 0.1.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/typespec/gem.rb +1 -1
- data/lib/typespec.rb +4 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 96025d513e4fed1c7d44d6240b98a2ff679b7ab1
|
4
|
+
data.tar.gz: 7a6fa93f0aa7afce3ce599cdddb521adec3b1a08
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 951aad976d5e801b1748d266ffaf6bb8e4686d8ce5acf5134d0da32fdce86c1968bf9e9cbd7172fc18222c453af2ab227c499c39497a30affe4783ba033a9848
|
7
|
+
data.tar.gz: 7fb2355a44485f67db63a05a85c77d96cfe85e935d24f2b8be3ca8101222e81ebb729ba118a36bb702c53d36a52743995f4fe59b7b0ed0e4c5a94de1198fb5aa
|
data/lib/typespec/gem.rb
CHANGED
data/lib/typespec.rb
CHANGED
@@ -140,7 +140,7 @@ module Typespec
|
|
140
140
|
end
|
141
141
|
|
142
142
|
def valid?(struct, opts={})
|
143
|
-
if struct.
|
143
|
+
if struct.is_a? ::Struct
|
144
144
|
ignore_if_not_in_spec = opts.fetch(:ignore_if_not_in_spec, false)
|
145
145
|
struct.instance_variables.all? do |property|
|
146
146
|
undecorated = property.to_s[1..-1].to_sym
|
@@ -176,9 +176,9 @@ module Typespec
|
|
176
176
|
|
177
177
|
# ...
|
178
178
|
class Enum
|
179
|
-
def initialize(*can_take_on) @can_take_on =
|
180
|
-
def self.[](*can_take_on); Typespec::Enum.new(can_take_on); end
|
181
|
-
def valid?(
|
179
|
+
def initialize(*can_take_on) @can_take_on = can_take_on end
|
180
|
+
def self.[](*can_take_on); Typespec::Enum.new(*can_take_on); end
|
181
|
+
def valid?(value) @can_take_on.include?(value); end
|
182
182
|
end
|
183
183
|
end
|
184
184
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: typespec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.0.
|
4
|
+
version: 0.1.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Williams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-03-05 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Typespec is a way to specify complex schema made of types or specific
|
14
14
|
values and validate against them.
|