Parent

Class/Module Index [+]

Quicksearch

YARD::I18n::Message

Message is a translation target message. It has message ID as {id} and some properties {locations} and {comments}.

@since 0.8.1

Attributes

comments[R]

@return [Set] the set of comments for the messages.

id[R]

@return [String] the message ID of the trnslation target message.

locations[R]

@return [Set] the set of locations. Location is an array of path and line number where the message is appeared.

Public Class Methods

new(id) click to toggle source

Creates a trasnlate target message for message ID id.

@param [String] id the message ID of the translate target message.

# File lib/yard/i18n/message.rb, line 23
def initialize(id)
  @id = id
  @locations = Set.new
  @comments = Set.new
end

Public Instance Methods

==(other) click to toggle source

@param [Message] other the Message to be compared. @return [Boolean] checks whether this message is equal to another.

# File lib/yard/i18n/message.rb, line 48
def ==(other)
  other.is_a?(self.class) and
    @id == other.id and
    @locations == other.locations and
    @comments == other.comments
end
add_comment(comment) click to toggle source

Adds a comment for the message.

@param [String] comment the comment for the message to be added. @return [void]

# File lib/yard/i18n/message.rb, line 42
def add_comment(comment)
  @comments << comment unless comment.nil?
end
add_location(path, line) click to toggle source

Adds location information for the message.

@param [String] path the path where the message appears. @param [Integer] line the line number where the message appears. @return [void]

# File lib/yard/i18n/message.rb, line 34
def add_location(path, line)
  @locations << [path, line]
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.