proxy_method 1.2.6 → 1.2.7

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: 6f4af87ac13ed1ecd407497936bce7b5e57f16be2348460de75c65c490a756ec
4
- data.tar.gz: 344cc71d86ce1c8af010fe28ef7e8c6040de4237e2673806fbd822595927f684
3
+ metadata.gz: 349b2fa487eb9c008619d6fc51ac0bae9ad22d668ec464f30146d80251554d38
4
+ data.tar.gz: 6d4617e55964bb45b2eb9a35500b3652e263d275235d77fb76b3c4ae8b9f7ea8
5
5
  SHA512:
6
- metadata.gz: 379a2267013b8b47ee6c901a87acac2794103f049651b0eb50743d2deb5477afc14acb0ce94d38b4940ca19dcbf15138745484138e903e1a3ace957beecf1409
7
- data.tar.gz: d54ad49a095ec66ade4d46dfd299f835b651fa09554b79e3c59d98512643c8f1ac4827f9720b7e623e6bd09cb35603a2c6f3fd834a4cd9f63fa8fce6e86b0688
6
+ metadata.gz: 601349dfd1c43293eff336b047bb96d867795978563cb84735bca25a41427570001444448be6e71f291d690040b1c10526e00682a9cf2d66c7c831d15e86b329
7
+ data.tar.gz: 81160a09c8a39740c6a85458bf60013c6f41e36367d550b6c9db7d143ea30c96117fd405746d2589f73182970ab96449856fdf3c0722e7a38c362fb7de9115a7
data/lib/proxy_method.rb CHANGED
@@ -24,10 +24,12 @@ module ProxyMethod
24
24
  # end
25
25
  #
26
26
  # Dog.create
27
+ #
27
28
  # # => RuntimeError: Disabled by proxy_method
28
29
  #
29
30
  # Dog.destroy
30
- # # 'destroyed'
31
+ #
32
+ # # => 'destroyed'
31
33
  #
32
34
  # Or multiple method names:
33
35
  #
@@ -36,9 +38,11 @@ module ProxyMethod
36
38
  # end
37
39
  #
38
40
  # Dog.create
41
+ #
39
42
  # # => RuntimeError: Disabled by proxy_method
40
43
  #
41
44
  # Dog.destroy
45
+ #
42
46
  # # => RuntimeError: Disabled by proxy_method
43
47
  #
44
48
  # With a custom error message:
@@ -48,12 +52,14 @@ module ProxyMethod
48
52
  # end
49
53
  #
50
54
  # Dog.create
55
+ #
51
56
  # # => RuntimeError: Disabled!
52
57
  #
53
58
  # You can still access the unproxied version by prefixing 'unproxied_'
54
59
  # to the method name:
55
60
  #
56
61
  # Dog.unproxied_create
62
+ #
57
63
  # # => 'created'
58
64
  #
59
65
  # And you can change the prefix for unproxied versions:
@@ -63,6 +69,7 @@ module ProxyMethod
63
69
  # end
64
70
  #
65
71
  # Dog.original_create
72
+ #
66
73
  # # => 'created'
67
74
  #
68
75
  # Finally, you can actually *proxy* the method, by providing an
@@ -75,6 +82,7 @@ module ProxyMethod
75
82
  # end
76
83
  #
77
84
  # Dog.create
85
+ #
78
86
  # # => 'indirectly created'
79
87
 
80
88
  def proxy_class_method(*original_method_names, &proxy_block)
@@ -129,10 +137,12 @@ module ProxyMethod
129
137
  # end
130
138
  #
131
139
  # Dog.new.save
140
+ #
132
141
  # # => RuntimeError: Disabled by proxy_method
133
142
  #
134
143
  # Dog.new.upate
135
- # # 'updated'
144
+ #
145
+ # # => 'updated'
136
146
  #
137
147
  #
138
148
  # Or use the shorthand form:
@@ -148,9 +158,11 @@ module ProxyMethod
148
158
  # end
149
159
  #
150
160
  # Dog.new.save
161
+ #
151
162
  # # => RuntimeError: Disabled by proxy_method
152
163
  #
153
164
  # Dog.new.update
165
+ #
154
166
  # # => RuntimeError: Disabled by proxy_method
155
167
  #
156
168
  # With a custom error message:
@@ -160,12 +172,14 @@ module ProxyMethod
160
172
  # end
161
173
  #
162
174
  # Dog.new.save
175
+ #
163
176
  # # => RuntimeError: Disabled!
164
177
  #
165
178
  # You can still access the unproxied version by prefixing 'unproxied_'
166
179
  # to the method name:
167
180
  #
168
181
  # Dog.new.unproxied_save
182
+ #
169
183
  # # => 'saved'
170
184
  #
171
185
  # And you can change the prefix for unproxied versions:
@@ -175,6 +189,7 @@ module ProxyMethod
175
189
  # end
176
190
  #
177
191
  # Dog.new.original_save
192
+ #
178
193
  # # => 'saved'
179
194
  #
180
195
  # Finally, you can actually *proxy* the method, by providing an
@@ -187,6 +202,7 @@ module ProxyMethod
187
202
  # end
188
203
  #
189
204
  # Dog.new.save
205
+ #
190
206
  # # => 'indirectly saved'
191
207
 
192
208
  def proxy_instance_method(*original_method_names, &proxy_block)
@@ -1,3 +1,3 @@
1
1
  module ProxyMethod
2
- VERSION='1.2.6'
2
+ VERSION='1.2.7'
3
3
  end
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: 1.2.6
4
+ version: 1.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jaime Bellmyer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-01-07 00:00:00.000000000 Z
11
+ date: 2020-01-08 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