Class: HTML::Tag
- Includes:
- StripTags
- Defined in:
- lib/langhelp/langhelp-base.rb
Constant Summary
Constants included from StripTags
StripTags::ALT, StripTags::NQ, StripTags::Q
Instance Attribute Summary collapse
-
#content ⇒ Object
Returns the value of attribute content.
-
#element ⇒ Object
Returns the value of attribute element.
-
#filename ⇒ Object
Returns the value of attribute filename.
-
#no ⇒ Object
Returns the value of attribute no.
Instance Method Summary collapse
Methods included from StripTags
Instance Attribute Details
#content ⇒ Object
Returns the value of attribute content
432 433 434 |
# File 'lib/langhelp/langhelp-base.rb', line 432 def content @content end |
#element ⇒ Object
Returns the value of attribute element
432 433 434 |
# File 'lib/langhelp/langhelp-base.rb', line 432 def element @element end |
#filename ⇒ Object
Returns the value of attribute filename
432 433 434 |
# File 'lib/langhelp/langhelp-base.rb', line 432 def filename @filename end |
#no ⇒ Object
Returns the value of attribute no
432 433 434 |
# File 'lib/langhelp/langhelp-base.rb', line 432 def no @no end |
Instance Method Details
#label ⇒ Object
441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 |
# File 'lib/langhelp/langhelp-base.rb', line 441 def label self.content = content.dup html2txt! content content.gsub! /\r?\n/, ' ' if element =~ /^<h([1-6])/i header = " " + "="*$1.to_i + " " elsif element =~ /^<dt/i header = " : " elsif element =~ /^<title/i header = "Title: " else raise "cannot happen" end header + content end |