module Parser::Messages
@api private
Public Class Methods
compile(reason, arguments)
click to toggle source
Formats the message, returns a raw template if there's nothing to interpolate
Code like `format(“”, {})` gives a warning, and so this method tries interpolating only if `arguments` hash is not empty.
@api private
# File lib/parser/messages.rb, line 111 def self.compile(reason, arguments) template = MESSAGES[reason] return template if Hash === arguments && arguments.empty? format(template, arguments) end