Class: String

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

Overview

Some quick string regex helpers

Instance Method Summary collapse

Instance Method Details

#is_independent?Boolean

identifiers if the text has “ claim N ” in it note this is not foolproof since some claims aren’t worded this way (few, but some)

Returns:

  • (Boolean)


27
28
29
# File 'lib/patento.rb', line 27

def is_independent?
	self.match(/\sclaim\s\d*\s/) ? true : false
end

#is_preamble?Boolean

identifies if the text contains “N. …” where N is the claim number

Returns:

  • (Boolean)


21
22
23
# File 'lib/patento.rb', line 21

def is_preamble?
	self.match(/^\d*\.\s/) ? true : false
end