Class: String

Inherits:
Object show all
Defined in:
app/models/generic_grep.rb

Overview

Copyright (C) 2011-2012 by Greg Lawson

<[email protected]>

Copyright: See COPYING file that comes with this distribution

require 'app/models/global.rb'

Instance Method Summary collapse

Instance Method Details

#single_grep(context, pattern) ⇒ Object

Low level single line match. Called by nested_grep


11
12
13
14
15
16
17
18
19
# File 'app/models/generic_grep.rb', line 11

def single_grep(context, pattern)
	regexp=Regexp.new(pattern)
	matchData=regexp.match(self)
	if matchData then
		ActiveSupport::HashWithIndifferentAccess.new(:context => context, :matchData => matchData)
	else
		nil #don't select line for return
	end #if
end