proxy_method 1.2.8 → 1.2.9

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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +16 -16
  3. data/lib/proxy_method/version.rb +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f62b39fd7673682664d46790b9cab031eb446be4c13fb64b099336714691af10
4
- data.tar.gz: ae08eabd749e6ba1bc337ac6c79fa18723ec0cff3a92826f3749900883b067f5
3
+ metadata.gz: f195076f22b772b57c64d8e0afe50cad3439be1a9a9d77600b4f39f7bee132c0
4
+ data.tar.gz: 858def85da8d7136b3d85bae784f0213cc821dea7936e762d70e0fb736351507
5
5
  SHA512:
6
- metadata.gz: 1529ce5172ffe132b45fdefa7852138cfe9f7ce84a638e13271b45e16ad773424c653b39f5b1f64870c55938b3c16576e4ddef70b7284b83d567436c614d22f3
7
- data.tar.gz: 48d066f75e4aaf0ffddb163d9d7cf7ae4cf65a662a350b797adc30697af70ddb5a2dce9ee9c1d12bdb2894eaabc6e2a417a0054cac4567ea1b182be18ae62752
6
+ metadata.gz: 65e3277fc3cd9da097a8c68de2ebdd19a8842487949fa0e02a6cb848bb922b31d8099679ee990fbe8ff987f35f16ebbef8387853bc968c41bbdc413ec07338eb
7
+ data.tar.gz: c2f16bc7f971e039a8c01d5e0434df0a8c5118b78876af6d1a22913a6c7fe964a54c94dbf65bd4d62f7dc0207e3b465b74914d1bb32c0c180fadc37bef40c84f
data/README.md CHANGED
@@ -49,13 +49,13 @@ You can do this:
49
49
  Turtle.create
50
50
  # => RuntimeError: Disabled by proxy_method
51
51
 
52
- Turtle.new.save
52
+ Turtle.new.save
53
53
  # => RuntimeError: Disabled by proxy_method
54
54
 
55
- Turtle.unproxied_create
55
+ Turtle.unproxied_create
56
56
  # => 'created'
57
57
 
58
- Turtle.new.unproxied_save
58
+ Turtle.new.unproxied_save
59
59
  # => 'saved'
60
60
 
61
61
  Raise a custom error message:
@@ -66,7 +66,7 @@ Raise a custom error message:
66
66
  proxy_method :save, raise: "Don't save here, use an interactor!"
67
67
  end
68
68
 
69
- CustomCow.new.save
69
+ CustomCow.new.save
70
70
  # => RunTimeError: Don't save here, use an interactor!
71
71
 
72
72
  Specify multiple methods at once:
@@ -77,10 +77,10 @@ Specify multiple methods at once:
77
77
  proxy_method :save, :update, raise: "Use an interactor!"
78
78
  end
79
79
 
80
- MultiMonkey.new.save
80
+ MultiMonkey.new.save
81
81
  # => RunTimeError: Use an interactor!
82
82
 
83
- MultiMonkey.new.update
83
+ MultiMonkey.new.update
84
84
  # => RunTimeError: Use an interactor!
85
85
 
86
86
  Supply your own prefix for the original, unproxied method:
@@ -91,7 +91,7 @@ Supply your own prefix for the original, unproxied method:
91
91
  proxy_method :save, prefix: 'pelican_'
92
92
  end
93
93
 
94
- PrefixPelican.new.pelican_save
94
+ PrefixPelican.new.pelican_save
95
95
  # => 'saved'
96
96
 
97
97
  Use an "unproxied" version of an instance:
@@ -105,10 +105,10 @@ Use an "unproxied" version of an instance:
105
105
  duck = DefaultDuck.new
106
106
  duck_unproxied = duck.unproxied
107
107
 
108
- duck.save
108
+ duck.save
109
109
  # => RunTimeError: Disabled by proxy_method
110
110
 
111
- duck_unproxied.save
111
+ duck_unproxied.save
112
112
  # => 'saved'
113
113
 
114
114
 
@@ -122,10 +122,10 @@ You can also use an unproxied version of the entire class:
122
122
  duck = DefaultDuck.new
123
123
  duck_unproxied = DefaultDuck.unproxied.new
124
124
 
125
- duck.save
125
+ duck.save
126
126
  # => RunTimeError: Disabled by proxy_method
127
127
 
128
- duck_unproxied.save
128
+ duck_unproxied.save
129
129
  # => 'saved'
130
130
 
131
131
  Run a custom block, instead of raising an exception at all. In other words, *actually* proxy the
@@ -140,7 +140,7 @@ yourself:
140
140
  end
141
141
  end
142
142
 
143
- MethodicalMeerkat.new.save
143
+ MethodicalMeerkat.new.save
144
144
  # => 'indirectly saved!'
145
145
 
146
146
  The object which is passed to the block is already unproxied, so it's free to use as you'd expect.
@@ -155,10 +155,10 @@ From there, you can allow your proxied block it to be used for multiple methods:
155
155
  end
156
156
  end
157
157
 
158
- MethodicalMeerkat.new.save
158
+ MethodicalMeerkat.new.save
159
159
  # => 'indirectly saved!'
160
160
 
161
- MethodicalMeerkat.new.update
161
+ MethodicalMeerkat.new.update
162
162
  # => 'indirectly updated!'
163
163
 
164
164
  Provide your proxied block with args and a block of its own. The block will be given the
@@ -173,10 +173,10 @@ so it works in much the same way.
173
173
  end
174
174
  end
175
175
 
176
- MethodicalMeerkat.new.save
176
+ MethodicalMeerkat.new.save
177
177
  # => 'indirectly saved!'
178
178
 
179
- MethodicalMeerkat.new.update
179
+ MethodicalMeerkat.new.update
180
180
  # => 'indirectly updated!'
181
181
 
182
182
 
@@ -1,3 +1,3 @@
1
1
  module ProxyMethod
2
- VERSION='1.2.8'
2
+ VERSION='1.2.9'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: proxy_method
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.8
4
+ version: 1.2.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jaime Bellmyer