Class: KuberKit::UI::Api
Defined Under Namespace
Classes: Task
Instance Method Summary collapse
- #create_task(title, &block) ⇒ Object
- #create_task_group ⇒ Object
- #print_debug(title, text) ⇒ Object
- #print_error(title, text) ⇒ Object
- #print_info(title, text) ⇒ Object
- #print_result(message, data = {}) ⇒ Object
- #print_warning(title, text) ⇒ Object
Methods inherited from Simple
Instance Method Details
#create_task(title, &block) ⇒ Object
17 18 19 20 21 |
# File 'lib/kuber_kit/ui/api.rb', line 17 def create_task(title, &block) task = KuberKit::UI::Api::Task.new(title, &block) task.execute task.wait end |
#create_task_group ⇒ Object
13 14 15 |
# File 'lib/kuber_kit/ui/api.rb', line 13 def create_task_group TaskGroup.new(KuberKit::UI::Api::Task) end |
#print_debug(title, text) ⇒ Object
36 37 38 |
# File 'lib/kuber_kit/ui/api.rb', line 36 def print_debug(title, text) logger.debug(text) end |
#print_error(title, text) ⇒ Object
27 28 29 30 |
# File 'lib/kuber_kit/ui/api.rb', line 27 def print_error(title, text) logger.debug(text) print_json({error: text}) end |
#print_info(title, text) ⇒ Object
23 24 25 |
# File 'lib/kuber_kit/ui/api.rb', line 23 def print_info(title, text) logger.debug(text) end |
#print_result(message, data = {}) ⇒ Object
40 41 42 |
# File 'lib/kuber_kit/ui/api.rb', line 40 def print_result(, data = {}) print_json({message: }.merge(data)) end |
#print_warning(title, text) ⇒ Object
32 33 34 |
# File 'lib/kuber_kit/ui/api.rb', line 32 def print_warning(title, text) logger.debug(text) end |