Method: Sequence#holding?
- Defined in:
- lib/sequence.rb
#holding? ⇒ Boolean
like #holding, but position is reset only if block returns false or nil (or raises an exception).
270 271 272 273 274 275 276 277 |
# File 'lib/sequence.rb', line 270 def holding? oldpos=pos begin result=yield self ensure (self.pos=oldpos) unless result end end |