Class: Proc
Instance Method Summary collapse
Instance Method Details
#change? ⇒ Boolean
204 205 206 207 208 209 |
# File 'lib/bacon.rb', line 204 def change? pre_result = yield called = call post_result = yield pre_result != post_result end |
#raise?(*exceptions) ⇒ Boolean
180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 |
# File 'lib/bacon.rb', line 180 def raise?(*exceptions) exceptions << RuntimeError if exceptions.empty? call # Only to work in 1.9.0, rescue with splat doesn't work there right now rescue Object => e case e when *exceptions e else raise e end else false end |
#throw?(sym) ⇒ Boolean
196 197 198 199 200 201 202 |
# File 'lib/bacon.rb', line 196 def throw?(sym) catch(sym) { call return false } return true end |