Class: RDoc::Generator::POT::POEntry (Ruby 2.7.3)
Description: Class : RDoc::Generator::POT::POEntry - Ruby 2.7.3

### Home Classes Methods

### In Files

- rdoc/generator/pot/po_entry.rb

### Parent

Object

### Methods

- ::new
- #merge
- #to_s

### Class/Module Index

Quicksearch

- RDoc
- RDoc::Alias
- RDoc::AnonClass
- RDoc::AnyMethod
- RDoc::Attr
- RDoc::ClassModule
- RDoc::CodeObject
- RDoc::Comment
- RDoc::Constant
- RDoc::Context
- RDoc::Context::Section
- RDoc::CrossReference
- RDoc::ERBIO
- RDoc::ERBPartial
- RDoc::Encoding
- RDoc::Error
- RDoc::Extend
- RDoc::Generator
- RDoc::Generator::Darkfish
- RDoc::Generator::JsonIndex
- RDoc::Generator::Markup
- RDoc::Generator::POT
- RDoc::Generator::POT::MessageExtractor
- RDoc::Generator::POT::PO
- RDoc::Generator::POT::POEntry
- RDoc::Generator::RI
- RDoc::GhostMethod
- RDoc::I18n
- RDoc::I18n::Locale
- RDoc::I18n::Text
- RDoc::Include
- RDoc::Markdown
- RDoc::Markdown::Literals
- RDoc::Markup
- RDoc::Markup::AttrChanger
- RDoc::Markup::AttrSpan
- RDoc::Markup::AttributeManager
- RDoc::Markup::Attributes
- RDoc::Markup::BlankLine
- RDoc::Markup::BlockQuote
- RDoc::Markup::Document
- RDoc::Markup::Formatter
- RDoc::Markup::HardBreak
- RDoc::Markup::Include
- RDoc::Markup::IndentedParagraph
- RDoc::Markup::List
- RDoc::Markup::ListItem
- RDoc::Markup::Paragraph
- RDoc::Markup::Parser
- RDoc::Markup::Parser::Error
- RDoc::Markup::Parser::MyStringScanner
- RDoc::Markup::Parser::ParseError
- RDoc::Markup::PreProcess
- RDoc::Markup::Raw
- RDoc::Markup::RegexpHandling
- RDoc::Markup::Rule
- RDoc::Markup::ToAnsi
- RDoc::Markup::ToBs
- RDoc::Markup::ToHtml
- RDoc::Markup::ToHtmlCrossref
- RDoc::Markup::ToHtmlSnippet
- RDoc::Markup::ToJoinedParagraph
- RDoc::Markup::ToLabel
- RDoc::Markup::ToMarkdown
- RDoc::Markup::ToRdoc
- RDoc::Markup::ToTableOfContents
- RDoc::Markup::ToTest
- RDoc::Markup::ToTtOnly
- RDoc::Markup::Verbatim
- RDoc::MetaMethod
- RDoc::MethodAttr
- RDoc::Mixin
- RDoc::NormalClass
- RDoc::NormalModule
- RDoc::Options
- RDoc::Parser
- RDoc::Parser::C
- RDoc::Parser::ChangeLog
- RDoc::Parser::Markdown
- RDoc::Parser::RD
- RDoc::Parser::RipperStateLex
- RDoc::Parser::RipperStateLex::InnerStateLex
- RDoc::Parser::Ruby
- RDoc::Parser::RubyTools
- RDoc::Parser::Simple
- RDoc::Parser::Text
- RDoc::RD
- RDoc::RD::BlockParser
- RDoc::RD::Inline
- RDoc::RD::InlineParser
- RDoc::RDoc
- RDoc::RI
- RDoc::RI::Driver
- RDoc::RI::Driver::Error
- RDoc::RI::Driver::NotFoundError
- RDoc::RI::Error
- RDoc::RI::Paths
- RDoc::RI::Task
- RDoc::Require
- RDoc::RubygemsHook
- RDoc::Servlet
- RDoc::SingleClass
- RDoc::Stats
- RDoc::Stats::Normal
- RDoc::Stats::Quiet
- RDoc::Stats::Verbose
- RDoc::Store
- RDoc::Store::Error
- RDoc::Store::MissingFileError
- RDoc::Task
- RDoc::Text
- RDoc::TokenStream
- RDoc::TomDoc
- RDoc::TopLevel
- RDocTask

No matching classes.

# RDoc::Generator::POT::POEntry

A PO entry in PO

### Attributes

extracted_comment[R]

The comment content extracted from source file

flags[R]

The flags of the PO entry

msgid[R]

The msgid content

msgstr[R]

The msgstr content

references[R]

The locations where the PO entry is extracted

translator_comment[R]

The comment content created by translator (PO editor)

### Public Class Methods

new(msgid, options = {}) click to toggle source

Creates a PO entry for `msgid`. Other valus can be specified by `options`.

                   # File rdoc/generator/pot/po_entry.rb, line 29
    def initialize msgid, options = {}
      @msgid = msgid
      @msgstr = options[:msgstr] || ""
      @translator_comment = options[:translator_comment]
      @extracted_comment = options[:extracted_comment]
      @references = options[:references] || []
      @flags = options[:flags] || []
    end

### Public Instance Methods

merge(other_entry) click to toggle source

Merges the PO entry with `other_entry`.

                   # File rdoc/generator/pot/po_entry.rb, line 56
    def merge other_entry
      options = {
        :extracted_comment  => merge_string(@extracted_comment,
                                            other_entry.extracted_comment),
        :translator_comment => merge_string(@translator_comment,
                                            other_entry.translator_comment),
        :references         => merge_array(@references,
                                           other_entry.references),
        :flags              => merge_array(@flags,
                                           other_entry.flags),
      }
      self.class.new(@msgid, options)
    end

to_s() click to toggle source

Returns the PO entry in PO format.

                   # File rdoc/generator/pot/po_entry.rb, line 41
      def to_s
        entry = ''
        entry += format_translator_comment
        entry += format_extracted_comment
        entry += format_references
        entry += format_flags
        entry += <<-ENTRY
    msgid #{format_message(@msgid)}
    msgstr #{format_message(@msgstr)}
        ENTRY
      end