Module: Radfish::CLI::Base
- Defined in:
- lib/radfish/cli/base.rb
Defined Under Namespace
Modules: ClassMethods
Class Method Summary collapse
Instance Method Summary collapse
- #error(message) ⇒ Object
- #info_msg(message) ⇒ Object
- #safe_call ⇒ Object
- #success(message) ⇒ Object
- #with_client(&block) ⇒ Object
Class Method Details
.included(base) ⇒ Object
6 7 8 |
# File 'lib/radfish/cli/base.rb', line 6 def self.included(base) base.extend(ClassMethods) end |
Instance Method Details
#error(message) ⇒ Object
24 25 26 |
# File 'lib/radfish/cli/base.rb', line 24 def error() self.class.cli_instance.send(:error, ) end |
#info_msg(message) ⇒ Object
28 29 30 |
# File 'lib/radfish/cli/base.rb', line 28 def info_msg() self.class.cli_instance.send(:info_msg, ) end |
#safe_call ⇒ Object
32 33 34 35 36 |
# File 'lib/radfish/cli/base.rb', line 32 def safe_call yield rescue => e [:verbose] ? e. : nil end |
#success(message) ⇒ Object
20 21 22 |
# File 'lib/radfish/cli/base.rb', line 20 def success() self.class.cli_instance.send(:success, ) end |
#with_client(&block) ⇒ Object
16 17 18 |
# File 'lib/radfish/cli/base.rb', line 16 def with_client(&block) self.class.cli_instance.send(:with_client, &block) end |