Method: YARD::I18n::Messages#register

Defined in:
lib/yard/i18n/messages.rb

#register(id) ⇒ Message

Registers a YARD::I18n::Message, the message ID of which is id. If corresponding Message is already registered, the previously registered object is returned.

Parameters:

  • id (String)

    the ID of the message to be registered.

Returns:

  • (Message)

    the registered Message.

Since:

  • 0.8.1



37
38
39
# File 'lib/yard/i18n/messages.rb', line 37

def register(id)
  @messages[id] ||= Message.new(id)
end