Module: Clomp::CommonStates

Included in:
Track
Defined in:
lib/clomp/common_states.rb

Constant Summary collapse

FAILURE =
'failure'
SUCCESS =
'success'
PENDING =
'pending'

Instance Method Summary collapse

Instance Method Details

#exception_raised?Boolean

Any exception raise!

Returns:

  • (Boolean)


34
35
36
# File 'lib/clomp/common_states.rb', line 34

def exception_raised?
  @error && @error.present?
end

#failure?Boolean

Track#failure? successfully failure!

Returns:

  • (Boolean)


18
19
20
# File 'lib/clomp/common_states.rb', line 18

def failure?
  @state && @state == FAILURE
end

#mark_as_failure!Object

Track#mark_as_failure! flag the track as unsuccessful track



29
30
31
# File 'lib/clomp/common_states.rb', line 29

def mark_as_failure!
  @state && @state = FAILURE
end

#mark_as_success!Object

Track#mark_as_success! flag the track as successful track FIXME improve the flagship of track status! Should we use integer instead of string?



24
25
26
# File 'lib/clomp/common_states.rb', line 24

def mark_as_success!
  @state && @state = SUCCESS
end

#pending?Boolean

Track#pending? not executed tracks!

Returns:

  • (Boolean)


8
9
10
# File 'lib/clomp/common_states.rb', line 8

def pending?
  @state && @state == PENDING
end

#success?Boolean

Track#success? successfully executed!

Returns:

  • (Boolean)


13
14
15
# File 'lib/clomp/common_states.rb', line 13

def success?
  @state && @state == SUCCESS
end