Class: HammerCLIForemanTasks::TaskProgress
- Inherits:
-
Object
- Object
- HammerCLIForemanTasks::TaskProgress
- Defined in:
- lib/hammer_cli_foreman_tasks/task_progress.rb
Instance Attribute Summary collapse
-
#interval ⇒ Object
Returns the value of attribute interval.
-
#task ⇒ Object
Returns the value of attribute task.
Instance Method Summary collapse
-
#initialize(task_id, &block) ⇒ TaskProgress
constructor
A new instance of TaskProgress.
- #render ⇒ Object
- #success? ⇒ Boolean
Constructor Details
#initialize(task_id, &block) ⇒ TaskProgress
Returns a new instance of TaskProgress.
6 7 8 9 10 |
# File 'lib/hammer_cli_foreman_tasks/task_progress.rb', line 6 def initialize(task_id, &block) @update_block = block @task_id = task_id @interval = 2 end |
Instance Attribute Details
#interval ⇒ Object
Returns the value of attribute interval.
4 5 6 |
# File 'lib/hammer_cli_foreman_tasks/task_progress.rb', line 4 def interval @interval end |
#task ⇒ Object
Returns the value of attribute task.
4 5 6 |
# File 'lib/hammer_cli_foreman_tasks/task_progress.rb', line 4 def task @task end |
Instance Method Details
#render ⇒ Object
12 13 14 15 |
# File 'lib/hammer_cli_foreman_tasks/task_progress.rb', line 12 def render update_task render_progress end |
#success? ⇒ Boolean
17 18 19 |
# File 'lib/hammer_cli_foreman_tasks/task_progress.rb', line 17 def success? !%w(error warning).include?(@task['result']) end |