Module: Clamp::Messages

Included in:
Clamp
Defined in:
lib/clamp/messages.rb

Overview

Message lookup, to allow localization.

Instance Method Summary collapse

Instance Method Details

#clear_messages!Object


17
18
19
# File 'lib/clamp/messages.rb', line 17

def clear_messages!
  init_default_messages
end

#message(key, options = {}) ⇒ Object


13
14
15
# File 'lib/clamp/messages.rb', line 13

def message(key, options = {})
  format(messages.fetch(key), options)
end

#messages=(new_messages) ⇒ Object


9
10
11
# File 'lib/clamp/messages.rb', line 9

def messages=(new_messages)
  messages.merge!(new_messages)
end