Class: DTK::Client::TaskStatus::StreamMode::Element::Stage::Cursor

Inherits:
Object
  • Object
show all
Defined in:
lib/task_status/stream_mode/element/stage.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeCursor

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

#stageObject (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_forObject (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

Returns:

  • (Boolean)


55
56
57
# File 'lib/task_status/stream_mode/element/stage.rb', line 55

def task_end?
  @task_end
end