Module: HammerCLI::Messages::ClassMethods

Defined in:
lib/hammer_cli/messages.rb

Instance Method Summary collapse

Instance Method Details

#failure_message(msg = nil) ⇒ Object



46
47
48
# File 'lib/hammer_cli/messages.rb', line 46

def failure_message(msg=nil)
  failure_message_for :default, msg
end

#failure_message_for(action, msg = nil) ⇒ Object



40
41
42
43
44
# File 'lib/hammer_cli/messages.rb', line 40

def failure_message_for(action, msg=nil)
  @failure_message ||= {}
  @failure_message[action] = msg unless msg.nil?
  @failure_message[action]
end

#success_message(msg = nil) ⇒ Object



36
37
38
# File 'lib/hammer_cli/messages.rb', line 36

def success_message(msg=nil)
  success_message_for :default, msg
end

#success_message_for(action, msg = nil) ⇒ Object



30
31
32
33
34
# File 'lib/hammer_cli/messages.rb', line 30

def success_message_for(action, msg=nil)
  @success_message ||= {}
  @success_message[action] = msg unless msg.nil?
  @success_message[action]
end