ruby_bots 0.0.16 → 0.0.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: 8edabf893242432d5b0a513a2fdac99ea2799a504e06a5b3e1fa02b39c701a64
4
- data.tar.gz: 149731352ba25091b61fa16ac1cf70069a0f21fd355e8a2c261c10916ce900e6
3
+ metadata.gz: 479eb599bb7d609945beb6cd0d2648ee76f7e3358f5dc7c28ec45f485221b252
4
+ data.tar.gz: 4019003a128b3a8bd7e13fdac2469eaee10320fe4b1922333f4d38b7153d577a
5
5
  SHA512:
6
- metadata.gz: e77831c3296c2913280c7c31f24a62a911f9b046deef425afc959fbcd7a5291ff35255fc81b21ce0f222b707f4015a5fbd41e599fcb2ea55f456e8d3263b111b
7
- data.tar.gz: dd4e5b2ac95e560f744397ba84d2b2e43b1e5d9857e2c9e28d7ac3d96f2c5810ca98063ae537c448cb82bb66eec250e6bc25a3b1aa7609c7b6badde661c99589
6
+ metadata.gz: a9fbafa3517990b266602d631439a96bbba87f639d12e5607fcb0d219a548526c5868d1a63f948a19bdf64534f0adc0345fdbfd47f6446c437e6e1918a13b324
7
+ data.tar.gz: a00b120207f15c70a74520554093609f7740fc27ae1dd94ebac93269c110ff9f82f42672b5cf0198a84ff5e2b5640fccc7f3cc4b67f03822ebcc477bad50bbf4
@@ -13,33 +13,37 @@ module RubyBots
13
13
  end
14
14
 
15
15
  def self.validate_inputs(method)
16
- @@input_validators ||= []
17
- @@input_validators << method
16
+ @input_validators ||= []
17
+ @input_validators << method
18
18
  end
19
19
 
20
20
  def self.validate_outputs(method)
21
- @@output_validators ||= []
22
- @@output_validators << method
21
+ @output_validators ||= []
22
+ @output_validators << method
23
23
  end
24
24
 
25
25
  def response(input)
26
- @@input_validators.each do |validator|
26
+ self.class.input_validators ||= []
27
+ self.class.input_validators.each do |validator|
27
28
  send(validator, input)
28
29
  end
29
30
 
30
31
  if @errors.empty?
31
32
  output = run(input)
32
33
  else
33
- raise RubyBots::Errors::InvalidInputError.new(errors: @errors)
34
+ raise RubyBots::InvalidInputError.new(errors: @errors)
34
35
  end
35
36
 
36
- @@output_validators.each do |validator|
37
+ self.class.output_validators ||= []
38
+ self.class.output_validators.each do |validator|
37
39
  send(validator, output)
38
40
  end
39
41
 
40
42
  if @errors.any?
41
- raise RubyBots::Errors::InvalidOutputError.new(errors: @errors)
43
+ raise RubyBots::InvalidOutputError.new(errors: @errors)
42
44
  end
45
+
46
+ output
43
47
  end
44
48
 
45
49
  private
@@ -1,3 +1,3 @@
1
1
  module RubyBots
2
- VERSION = "0.0.16".freeze
2
+ VERSION = "0.0.18".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.16
4
+ version: 0.0.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Paulson