Class: ParagraphContainer

Inherits:
Container show all
Defined in:
lib/ribit/contentparser.rb

Instance Method Summary collapse

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

#initializeParagraphContainer

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_sObject



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