typespec 0.1.0.7 → 0.1.0.8

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 119a78d55a6883427d8a309f492bf5b0b4a0ec27
4
- data.tar.gz: 2d93ed4b2b71ef92a392788b240737790bae613f
3
+ metadata.gz: 96025d513e4fed1c7d44d6240b98a2ff679b7ab1
4
+ data.tar.gz: 7a6fa93f0aa7afce3ce599cdddb521adec3b1a08
5
5
  SHA512:
6
- metadata.gz: bd6c90fe94c6dcc5fc45189badfe3aa996032bc29acdf8b54ece851e1467ad1593fac1dc7c01b215415f2b26020d746f28f5d3982de3fe5f82cf858ca37b6154
7
- data.tar.gz: 65dc8ed51f8dfd2b0288018ee5cdeaede4075ed0cb5b2ba0d52cf4c68f6e73fb4ae0d055540e80c8e01550621ef236266f638481207ebaabdcf84690cce506d8
6
+ metadata.gz: 951aad976d5e801b1748d266ffaf6bb8e4686d8ce5acf5134d0da32fdce86c1968bf9e9cbd7172fc18222c453af2ab227c499c39497a30affe4783ba033a9848
7
+ data.tar.gz: 7fb2355a44485f67db63a05a85c77d96cfe85e935d24f2b8be3ca8101222e81ebb729ba118a36bb702c53d36a52743995f4fe59b7b0ed0e4c5a94de1198fb5aa
data/lib/typespec/gem.rb CHANGED
@@ -41,7 +41,7 @@ module Typespec
41
41
  end
42
42
 
43
43
  module VERSION #:nodoc:
44
- MAJOR, MINOR, PATCH, PRE = [0, 1, 0, 7]
44
+ MAJOR, MINOR, PATCH, PRE = [0, 1, 0, 8]
45
45
  STRING = [MAJOR, MINOR, PATCH, PRE].compact.join('.')
46
46
  end
47
47
 
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.instance_of? ::Object
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 = [*can_take_on] end
180
- def self.[](*can_take_on); Typespec::Enum.new(can_take_on); end
181
- def valid?(can_take_on) can_take_on.include?(@can_take_on); end
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.7
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: 2015-11-22 00:00:00.000000000 Z
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.