Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/rarff.rb

Overview

Custom scan that returns a boolean indicating whether the regex matched. TODO: Is there a way to avoid doing this?

Instance Method Summary collapse

Instance Method Details

#my_scan(re) ⇒ Object



11
12
13
14
15
16
17
18
# File 'lib/rarff.rb', line 11

def my_scan(re)
  hit = false
  scan(re) { |arr|
    yield arr if block_given?
    hit = true
  }
  hit
end