Class: Proc
Instance Method Summary collapse
Instance Method Details
#change? ⇒ Boolean
264 265 266 267 268 269 |
# File 'lib/bacon.rb', line 264 def change? pre_result = yield called = call post_result = yield pre_result != post_result end |
#raise?(*exceptions) ⇒ Boolean
248 249 250 251 252 253 254 |
# File 'lib/bacon.rb', line 248 def raise?(*exceptions) call rescue *(exceptions.empty? ? RuntimeError : exceptions) => e e else false end |
#throw?(sym) ⇒ Boolean
256 257 258 259 260 261 262 |
# File 'lib/bacon.rb', line 256 def throw?(sym) catch(sym) { call return false } return true end |