# frozen_string_literal: true module Clamp #:nodoc: # Message lookup, to allow localization. # module Messages def messages=(new_messages) messages.merge!(new_messages) end def message(key, options = {}) string = messages.fetch(key) return string if options.empty? format string, options end def clear_messages! init_default_messages end private DEFAULTS = { too_many_arguments: "too many arguments", option_required: "option '%