Class: DTK::Client::TaskStatus::StreamMode::Element::Stage::Cursor
- Inherits:
-
Object
- Object
- DTK::Client::TaskStatus::StreamMode::Element::Stage::Cursor
- Defined in:
- lib/task_status/stream_mode/element/stage.rb
Instance Attribute Summary collapse
-
#stage ⇒ Object
readonly
Returns the value of attribute stage.
-
#wait_for ⇒ Object
readonly
Returns the value of attribute wait_for.
Instance Method Summary collapse
- #advance!(task_end) ⇒ Object
-
#initialize ⇒ Cursor
constructor
A new instance of Cursor.
- #task_end? ⇒ Boolean
Constructor Details
#initialize ⇒ Cursor
Returns a new instance of Cursor.
49 50 51 52 53 |
# File 'lib/task_status/stream_mode/element/stage.rb', line 49 def initialize @stage = 1 @wait_for = :start @task_end = false end |
Instance Attribute Details
#stage ⇒ Object (readonly)
Returns the value of attribute stage.
54 55 56 |
# File 'lib/task_status/stream_mode/element/stage.rb', line 54 def stage @stage end |
#wait_for ⇒ Object (readonly)
Returns the value of attribute wait_for.
54 55 56 |
# File 'lib/task_status/stream_mode/element/stage.rb', line 54 def wait_for @wait_for end |
Instance Method Details
#advance!(task_end) ⇒ Object
58 59 60 61 62 63 64 65 66 67 |
# File 'lib/task_status/stream_mode/element/stage.rb', line 58 def advance!(task_end) unless @task_end = task_end if @wait_for == :start @wait_for = :end else @stage += 1 @wait_for = :start end end end |
#task_end? ⇒ Boolean
55 56 57 |
# File 'lib/task_status/stream_mode/element/stage.rb', line 55 def task_end? @task_end end |