object_attorney 3.0.6 → 3.0.7

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: 3ab0c042c1e242f46f5132f0fc970c3a5fa73d4b
4
- data.tar.gz: 8d21894291faedb5700098b8aa856ac91b0020a4
3
+ metadata.gz: 7d3b6bf8836f5450f7ab3396c271972faf4d091f
4
+ data.tar.gz: 2aa5a1a9570fd4a8f0a7af07a90672efaa5a0a0c
5
5
  SHA512:
6
- metadata.gz: 747d24c58ba740f3c9ab0da1e5174f13b88ee5ee7ebc2377f8afe6b6cb27e348717b561fa2724a493608af05d31de7ca4e1f72828d4e892da54836b172764620
7
- data.tar.gz: df00f5eb4a1094018f46f7fd77ba4541e2694536722f3963f1eae89d036a4a91acb391a7aac34a3b571964e46e25d25302de1b7d9786197620af79df50a45a98
6
+ metadata.gz: 917dcb4494af280c9ca80bd2ef1645dd575ecef23775a6e1d991efd6854776777f33de2d437a0835ae4f7e29e322970651e6de300d083140b2f87839a29fa439
7
+ data.tar.gz: 9364ff0e8d4a81a6f04d404a632b294db9df1706012ef1f5c7daaed8397b928cf74a18f00c6acd30d9b3d312092422b10ac8b1b5235c11200a63bcfe75438026
@@ -1,5 +1,7 @@
1
1
  module ObjectAttorney
2
2
  module Errors
3
+ NoDefendantToDefendError = Class.new(StandardError)
4
+
3
5
  # ActiveModel::Errors told me to declare
4
6
  # the following methods for a minimal implementation
5
7
  module ClassMethods
@@ -1,5 +1,3 @@
1
- require 'object_attorney/errors'
2
-
3
1
  module ObjectAttorney
4
2
  module Helpers
5
3
  module_function
@@ -1,3 +1,3 @@
1
1
  module ObjectAttorney
2
- VERSION = '3.0.6'.freeze
2
+ VERSION = '3.0.7'.freeze
3
3
  end
@@ -1,4 +1,5 @@
1
1
  require 'active_model'
2
+ require 'object_attorney/errors'
2
3
  require 'object_attorney/version'
3
4
  require 'object_attorney/helpers'
4
5
  require 'object_attorney/class_methods'
@@ -10,6 +11,8 @@ module ObjectAttorney
10
11
  end
11
12
 
12
13
  def defendant_is_innocent?
14
+ raise Errors::NoDefendantToDefendError if defendant_options.empty?
15
+
13
16
  proven_innocent = defendants.map do |defendant|
14
17
  innocent_of_all_accusations?(defendant)
15
18
  end.all?
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: object_attorney
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.6
4
+ version: 3.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - João Gonçalves