try_api 0.1.17 → 0.1.18

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bb8ce1fd4ac728837bc4eeff6fb0414b94a0c7085ad6dc202e867c2efeaf53e0
4
- data.tar.gz: c09034cdd0274e913f5a733c791b6aaeaf7c56d6eefe975bf03ad2493c7eba66
3
+ metadata.gz: f48537bbdf347b8a8816351bf19fa3d4d3cd75b6c30329f4674a14a3f80f30ce
4
+ data.tar.gz: 15941bc0897cd195880101d0f96e7764948680562df35fd08980a8124d1645de
5
5
  SHA512:
6
- metadata.gz: f508a253d9b1b3f786b612eddfebb6e57a30d0da7f1734e89affa455569d73a925ea225eb580243724e9ae37560c54faf298525855f7a42cd307133d9c20c1cf
7
- data.tar.gz: ecdd122f8dd2d32318dfa609ebee504ef4969ebd08007469e699205b79bb7923a70d84ff85297319c7ff06e3fdddc763b0e1e99735fd46c2858bc6213a114af5
6
+ metadata.gz: 7dda40f948a57a0b281715467b46e9165ff24f425f0695c75f3ed25f256ffd6657e88b57beea1bd573931a9936cb7a4adf7ef9e65ac7218a14504fba6d1c2605
7
+ data.tar.gz: aca17a54cde9172cd6c2d6b84351bbcbff7f98c10ccb774090c040b493c828c97634ce24c886685b7572238ea2981b67f1cfb9d4aa6423cc0d80c398b9980ebd
@@ -1,5 +1,3 @@
1
- require "try_api/boolean"
2
-
3
1
  module TryApi
4
2
  class Base
5
3
 
@@ -10,7 +8,7 @@ module TryApi
10
8
  end
11
9
 
12
10
  define_method("#{name}=") do |value|
13
- if value.is_a?(type) || value.nil?
11
+ if type.is_a?(Array) ? type.any?{|t| value.is_a?(t) } : value.is_a?(type) || value.nil?
14
12
  if options[:items_type].try(:<, TryApi::Base)
15
13
 
16
14
  items = []
@@ -2,6 +2,6 @@ module TryApi
2
2
  class Cookie < TryApi::Base
3
3
  typesafe_accessor :name, String
4
4
  typesafe_accessor :description, String
5
- typesafe_accessor :global, Boolean, default: false
5
+ typesafe_accessor :global, [TrueClass, FalseClass], default: false
6
6
  end
7
7
  end
@@ -2,6 +2,6 @@ module TryApi
2
2
  class Header < TryApi::Base
3
3
  typesafe_accessor :name, String
4
4
  typesafe_accessor :description, String
5
- typesafe_accessor :global, Boolean, default: false
5
+ typesafe_accessor :global, [TrueClass, FalseClass], default: false
6
6
  end
7
7
  end
@@ -3,8 +3,8 @@ module TryApi
3
3
  typesafe_accessor :name, String
4
4
  typesafe_accessor :type, String
5
5
  typesafe_accessor :parameters, Array, default: [], items_type: TryApi::Parameter
6
- typesafe_accessor :required, Boolean, default: true
7
- typesafe_accessor :custom, Boolean, default: false, if: -> { self.type == 'object' }
6
+ typesafe_accessor :required, [TrueClass, FalseClass], default: true
7
+ typesafe_accessor :custom, [TrueClass, FalseClass], default: false, if: -> { self.type == 'object' }
8
8
  typesafe_accessor :description, String
9
9
  end
10
10
  end
@@ -1,3 +1,3 @@
1
1
  module TryApi
2
- VERSION = "0.1.17"
2
+ VERSION = "0.1.18"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: try_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.17
4
+ version: 0.1.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Skubenych
@@ -49,7 +49,6 @@ files:
49
49
  - app/controllers/try_api/projects_controller.rb
50
50
  - app/helpers/try_api/application_helper.rb
51
51
  - app/models/try_api/base.rb
52
- - app/models/try_api/boolean.rb
53
52
  - app/models/try_api/config_parser.rb
54
53
  - app/models/try_api/cookie.rb
55
54
  - app/models/try_api/example_response.rb
@@ -1,5 +0,0 @@
1
- module TryApi
2
- module Boolean; end
3
- class TrueClass; include Boolean; end
4
- class FalseClass; include Boolean; end
5
- end