In Files

  • rdoc/generator/pot/po.rb

Parent

Methods

Class/Module Index [+]

Quicksearch

RDoc::Generator::POT::PO

Generates a PO format text

Public Class Methods

new() click to toggle source

Creates an object that represents PO format.

 
               # File rdoc/generator/pot/po.rb, line 9
def initialize
  @entries = {}
  add_header
end
            

Public Instance Methods

add(entry) click to toggle source

Adds a PO entry to the PO.

 
               # File rdoc/generator/pot/po.rb, line 17
def add entry
  existing_entry = @entries[entry.msgid]
  if existing_entry
    entry = existing_entry.merge(entry)
  end
  @entries[entry.msgid] = entry
end
            
to_s() click to toggle source

Returns PO format text for the PO.

 
               # File rdoc/generator/pot/po.rb, line 28
def to_s
  po = ''
  sort_entries.each do |entry|
    po << "\n" unless po.empty?
    po << entry.to_s
  end
  po
end
            

Commenting is here to help enhance the documentation. For example, code samples, or clarification of the documentation.

If you have questions about Ruby or the documentation, please post to one of the Ruby mailing lists. You will get better, faster, help that way.

If you wish to post a correction of the docs, please do so, but also file bug report so that it can be corrected for the next release. Thank you.

If you want to help improve the Ruby documentation, please visit Documenting-ruby.org.