Sha256: a2e23ab3fbd94ee7a5c12753d8099a534fbb1a21d4d2fcf0420f666a5881fd4b

Contents?: true

Size: 898 Bytes

Versions: 10

Compression:

Stored size: 898 Bytes

Contents

module Clomp
  module CommonStates
    FAILURE = 'failure'
    SUCCESS = 'success'
    PENDING = 'pending'
    
    # Track#pending? not executed tracks!
    def pending?
      @state && @state == PENDING
    end
    
    # Track#success? successfully executed!
    def success?
      @state && @state == SUCCESS
    end
    
    # Track#failure? successfully failure!
    def failure?
      @state && @state == FAILURE
    end
    
    # Track#mark_as_success! flag the track as successful track
    # FIXME improve the flagship of track status! Should we use integer instead of string?
    def mark_as_success!
      @state && @state = SUCCESS
    end
    
    # Track#mark_as_failure! flag the track as unsuccessful track
    def mark_as_failure!
      @state && @state = FAILURE
    end
    
    # Any exception raise!
    def exception_raised?
      @error && @error.present?
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
clomp-1.0.0 lib/clomp/common_states.rb
clomp-0.1.0 lib/clomp/common_states.rb
clomp-0.0.10 lib/clomp/common_states.rb
clomp-0.0.9 lib/clomp/common_states.rb
clomp-0.0.8 lib/clomp/common_states.rb
clomp-0.0.7 lib/clomp/common_states.rb
clomp-0.0.6 lib/clomp/common_states.rb
clomp-0.0.5 lib/clomp/common_states.rb
clomp-0.0.4 lib/clomp/common_states.rb
clomp-0.0.3 lib/clomp/common_states.rb