ruby_bots 0.0.19 → 0.0.21

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: a079a3af0b9f2b688aa2bb5d3f59c2936ae02acf1bbe72c24b00c0ba1eb587ab
4
- data.tar.gz: bde27597290c67b77527fb591f6eae2ce630cf9934c6d503f5a9a7152ee29e7f
3
+ metadata.gz: 76d6f4b77a8ef6bc0f8124475142c2fb90460e9c9f602381eca42488aea99ea3
4
+ data.tar.gz: bf11eed995aec29f80a3f97f86fc1856f6c4733cdbe7d716cf705af0f9733ad4
5
5
  SHA512:
6
- metadata.gz: afa58f62e18ebd31ff703749a5bf786b8e7d7174972cd55c2b83f35778d348911405ab3d412659f3db9911d68433474664fee870ed909152bbe45760d10fe69d
7
- data.tar.gz: 9296e14a7827194f85bde5c40eee8be47c9f86869ab3c6a5004739dc8286b273dfbad9a0828724e27aaf471dacd7df49cf30f8fcd4410c721c685378b0c10141
6
+ metadata.gz: 7c052e9aad0d5de43e0ab7644b15ded54a84b1c87429a7780c455d80e93239e15a878a4d015eb9dde9383e300132d661e6e72218dff79b2ac8855117ab2aade3
7
+ data.tar.gz: 7fd242669b9332dec10d886ece3145ea3b76420459b5fb532e502f3050803d90cb839e6bb5e65711e6d79dc221a6dc6e5d9b5c115e019ead934bc8a877d8fd2d
@@ -12,12 +12,12 @@ module RubyBots
12
12
  attr_accessor :input_validators, :output_validators
13
13
  end
14
14
 
15
- def self.validate_inputs(method)
15
+ def self.validate_input(method)
16
16
  @input_validators ||= []
17
17
  @input_validators << method
18
18
  end
19
19
 
20
- def self.validate_outputs(method)
20
+ def self.validate_output(method)
21
21
  @output_validators ||= []
22
22
  @output_validators << method
23
23
  end
@@ -28,7 +28,7 @@ module RubyBots
28
28
  send(validator, input)
29
29
  end
30
30
 
31
- if self.errors.empty?
31
+ if @errors.empty?
32
32
  output = run(input)
33
33
  else
34
34
  raise RubyBots::InvalidInputError.new(errors: @errors)
@@ -39,7 +39,7 @@ module RubyBots
39
39
  send(validator, output)
40
40
  end
41
41
 
42
- if self.errors.any?
42
+ if @errors.any?
43
43
  raise RubyBots::InvalidOutputError.new(errors: @errors)
44
44
  end
45
45
 
@@ -56,6 +56,8 @@ module RubyBots
56
56
  JSON.parse(param)
57
57
  rescue JSON::ParserError
58
58
  errors << "invalid JSON"
59
+ rescue TypeError
60
+ errors << "value is not a String"
59
61
  end
60
62
  end
61
63
  end
@@ -1,3 +1,3 @@
1
1
  module RubyBots
2
- VERSION = "0.0.19".freeze
2
+ VERSION = "0.0.21".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_bots
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.19
4
+ version: 0.0.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Paulson