Class: YARD::I18n::Message
Relationships & Source Files | |
Inherits: | Object |
Defined in: | lib/yard/i18n/message.rb |
Overview
Message
is a translation target message. It has message ID as
#id and some properties #locations and #comments.
Class Method Summary
-
.new(id) ⇒ Message
constructor
Creates a translate target message for message ID #id.
Instance Attribute Summary
- #comments ⇒ Set readonly
- #id ⇒ String readonly
-
#locations ⇒ Set
readonly
path and line number where the message is appeared.
Instance Method Summary
- #==(other) ⇒ Boolean
-
#add_comment(comment) ⇒ void
Adds a comment for the message.
-
#add_location(path, line) ⇒ void
Adds location information for the message.
Constructor Details
.new(id) ⇒ Message
Creates a translate target message for message ID #id.
Instance Attribute Details
#comments ⇒ Set
(readonly)
# File 'lib/yard/i18n/message.rb', line 19
attr_reader :comments
#id ⇒ String (readonly)
# File 'lib/yard/i18n/message.rb', line 12
attr_reader :id
#locations ⇒ Set
(readonly)
path and line number where the message is appeared.
# File 'lib/yard/i18n/message.rb', line 16
attr_reader :locations
Instance Method Details
#==(other) ⇒ Boolean
#add_comment(comment) ⇒ void
This method returns an undefined value.
Adds a comment for the message.
# File 'lib/yard/i18n/message.rb', line 43
def add_comment(comment) @comments << comment unless comment.nil? end
#add_location(path, line) ⇒ void
This method returns an undefined value.
Adds location information for the message.
# File 'lib/yard/i18n/message.rb', line 35
def add_location(path, line) @locations << [path, line] end