google_perspective 0.1.3 → 0.1.4

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
  SHA1:
3
- metadata.gz: fc95fc60e4369cd9ab8d5d810c9ee61be8612e73
4
- data.tar.gz: b2bf539a2ded94d5de1e61c4fcb2b2ae4c686b7a
3
+ metadata.gz: e2f4e277e8bae164defd4336f6a2e584975ee7b2
4
+ data.tar.gz: 436cdcb75a924467aba88481720d82e75f920df1
5
5
  SHA512:
6
- metadata.gz: ae43aee0059c62ea2d28d978fc4a7d2437f801162ef1a83697cd5afbd6675f53b1c3d7d1a4e6ed27a51fb5257a43cdb219f3208aeb0d1fc1c1dbcde0fff04874
7
- data.tar.gz: 30447d1ecae9233765ecba4e90f8771f7980aa8428c088903a98fb1cec20f012df4345f3ca914fa827db38c623fec9614505de00e60efc9882d00fee23b1b56a
6
+ metadata.gz: 6f4b612a04b6cb024b0339db9cc31d19f005ccd90f8b41007638f0f0d189666cd3005f089619ffce462c474755107f2db09c5c1abe71c2da8da2aaca08fdddae
7
+ data.tar.gz: 63734695df3dafef2b086552b7148e7035c1ac5fb7bfb892b321da6772cacefe3ca9563b58c89e9375f872ee394e6c7222567e8f350f98f9301b5a000e0c298b
@@ -11,11 +11,15 @@ module GooglePerspective
11
11
  end
12
12
 
13
13
  def valid?
14
- result_scores.min <= score
14
+ result_score <= score
15
+ end
16
+
17
+ def result_score
18
+ result_scores.min
15
19
  end
16
20
 
17
21
  def result_scores
18
- response['attributeScores'].map do |_model, model_score|
22
+ @result_scores ||= response['attributeScores'].map do |_model, model_score|
19
23
  model_score.dig('summaryScore', 'value')
20
24
  end
21
25
  end
@@ -1,3 +1,3 @@
1
1
  module GooglePerspective
2
- VERSION = '0.1.3'.freeze
2
+ VERSION = '0.1.4'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google_perspective
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ruben Espinosa