class Text
Attributes
rule[RW]
Public Instance Methods
+(new_rule)
click to toggle source
# File lib/pertinent_parser/text.rb, line 10 def +(new_rule) @rule.add(new_rule) end
apply()
click to toggle source
Return the HTML after all rules are applied
# File lib/pertinent_parser/text.rb, line 5 def apply @rule.apply(self) end
replace(replacement, target, number=1)
click to toggle source
# File lib/pertinent_parser/text.rb, line 19 def replace(replacement, target, number=1) self.+(PertinentParser.new_replace(self, target, number, replacement)) end
wrap_in(tag, target, number=1)
click to toggle source
Wrap text, falling inside of existing boundaries
# File lib/pertinent_parser/text.rb, line 15 def wrap_in(tag, target, number=1) self.+(PertinentParser.new_wrap(self, target, number, tag)) end
wrap_out(tag, target, number=1)
click to toggle source
Wrap text, falling outside of existing boundaries
# File lib/pertinent_parser/text.rb, line 24 def wrap_out(tag, target, number=1) PertinentParser.new_wrap(self, target, number, tag).+(self) end