Module: HammerCLI::Messages

Included in:
Apipie::Command
Defined in:
lib/hammer_cli/messages.rb

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



5
6
7
# File 'lib/hammer_cli/messages.rb', line 5

def self.included(base)
  base.extend(ClassMethods)
end

Instance Method Details

#failure_messageObject



21
22
23
# File 'lib/hammer_cli/messages.rb', line 21

def failure_message
  self.class.failure_message
end

#failure_message_for(action) ⇒ Object



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

def failure_message_for(action)
  self.class.failure_message_for action
end

#handle_exception(e) ⇒ Object



25
26
27
# File 'lib/hammer_cli/messages.rb', line 25

def handle_exception(e)
  exception_handler.handle_exception e, :heading => failure_message
end

#success_messageObject



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

def success_message
  self.class.success_message
end

#success_message_for(action) ⇒ Object



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

def success_message_for(action)
  self.class.success_message_for action
end