Class: ParagraphContainer
- Defined in:
- lib/ribit/contentparser.rb
Instance Method Summary collapse
-
#initialize ⇒ ParagraphContainer
constructor
A new instance of ParagraphContainer.
- #to_s ⇒ Object
Methods inherited from Container
#<<, #add_child, #childs?, #get_childs, #get_parent, #replace, #set_childs, #text?
Methods included from Assert
assert, #assert, assert_nil, #assert_nil, #assert_not_nil, assert_not_nil, raise_exception
Constructor Details
#initialize ⇒ ParagraphContainer
Returns a new instance of ParagraphContainer.
861 862 863 864 |
# File 'lib/ribit/contentparser.rb', line 861 def initialize super( nil ) add_child( TextContainer.new( '' ) ) end |
Instance Method Details
#to_s ⇒ Object
867 868 869 870 871 872 873 874 875 |
# File 'lib/ribit/contentparser.rb', line 867 def to_s text = super # remove last line feed if exists if ( text[ text.size - 1 ] == 10 ) text.chop! end return '<p>' + text + '</p>' end |