proxy_method 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '07808eb01a4645e80fbde075254b0ae39a7eb4301c5fe035594337f202ab2cbf'
4
- data.tar.gz: c9b26c4bf4a112d2dbb134e4adac063140b70e26a4fb7ccaac95a0f19687e3f2
3
+ metadata.gz: 5a460c566052d51f5f1a31e54492446bf993f67f5fa1949eb741aa35fa883679
4
+ data.tar.gz: 8676ff3e48fc2a52b505f2c218fcbcb17543aac353745dfa8c99db7cd91b8b30
5
5
  SHA512:
6
- metadata.gz: e53e844eb9ad0640f907de886df62fc50550b6a70654eea26eb79a59c8fc1a0670fe0443499d244ed82a84e6c3b0e3e828d950480830bee35c1969c1e8347d10
7
- data.tar.gz: bbfc055815f09864dcf312b73b76df89062af0a15c66d736aeee2479f23e62164c70e5cc52ada54ca3040b5212113e1036a9449d0efa016a99f5626ff68ba88c
6
+ metadata.gz: ac4660fcb8882adf2648a8f91bbc2851c0d59a7bb3914f037435b09c256e65ea093dd6aacbfe0a68040d654f8b3cd7aa2840e88edb80f4a7f1507e0a443ae0e2
7
+ data.tar.gz: 7c87174a537070f13eb60765e1076f136b88377e4b7e7649e4223f972a27ff7e638c10cd86d1bde9a6105b948b0777f6289dff79373a32fa88b8fafb74ccd7c1
data/README.md CHANGED
@@ -58,12 +58,12 @@ You can do this:
58
58
  Turtle.new.unproxied_save
59
59
  # => 'saved'
60
60
 
61
- Specify a custom error message:
61
+ Raise a custom error message:
62
62
 
63
63
  class CustomCow < Animal
64
64
  include ProxyMethod
65
65
 
66
- proxy_method :save, message: "Don't save here, use an interactor!"
66
+ proxy_method :save, raise: "Don't save here, use an interactor!"
67
67
  end
68
68
 
69
69
  CustomCow.new.save
@@ -74,7 +74,7 @@ Specify multiple methods at once:
74
74
  class MultiMonkey < Animal
75
75
  include ProxyMethod
76
76
 
77
- proxy_method [:save, :update], message: "Use an interactor!"
77
+ proxy_method [:save, :update], raise: "Use an interactor!"
78
78
  end
79
79
 
80
80
  MultiMonkey.new.save
@@ -1,3 +1,3 @@
1
1
  module ProxyMethod
2
- VERSION = '0.1.2'
2
+ VERSION = '0.1.3'
3
3
  end
data/lib/proxy_method.rb CHANGED
@@ -19,7 +19,7 @@ module ProxyMethod
19
19
  def proxy_class_method(original_method_names, options = {})
20
20
  original_method_names = Array(original_method_names)
21
21
 
22
- error_message = options[:message] || DEFAULT_PROXY_MESSAGE
22
+ error_message = options[:raise] || DEFAULT_PROXY_MESSAGE
23
23
  prefix = options[:prefix] || DEFAULT_PREFIX
24
24
 
25
25
  original_method_names.each do |original_method_name|
@@ -40,7 +40,7 @@ module ProxyMethod
40
40
  def proxy_instance_method(original_method_names, options = {})
41
41
  original_method_names = Array(original_method_names)
42
42
 
43
- error_message = options[:message] || DEFAULT_PROXY_MESSAGE
43
+ error_message = options[:raise] || DEFAULT_PROXY_MESSAGE
44
44
  prefix = options[:prefix] || DEFAULT_PREFIX
45
45
 
46
46
  original_method_names.each do |original_method_name|
@@ -30,9 +30,9 @@ end
30
30
  class Turtle < Animal
31
31
  include ProxyMethod
32
32
 
33
- proxy_class_method :create, message: "Don't Create directly, use Interactor!"
34
- proxy_instance_method :update, message: "Don't Update directly, use Interactor!"
35
- proxy_method :save, message: "Don't Save directly, use Interactor!"
33
+ proxy_class_method :create, raise: "Don't Create directly, use Interactor!"
34
+ proxy_instance_method :update, raise: "Don't Update directly, use Interactor!"
35
+ proxy_method :save, raise: "Don't Save directly, use Interactor!"
36
36
  end
37
37
 
38
38
  class DefaultDuck < Animal
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: proxy_method
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jaime Bellmyer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-12-19 00:00:00.000000000 Z
11
+ date: 2019-12-20 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: |2
14
14
  The purpose of this gem is to prevent directly running the inherited