Module: BaseChip::TrackState::InstanceMethods

Defined in:
lib/base_chip/track_state.rb

Instance Method Summary collapse

Instance Method Details

#error!(f, s) ⇒ Object



34
# File 'lib/base_chip/track_state.rb', line 34

def error!(  f,s); np(f,s); @state   = (@state =~ /fault/) ? 'error && fault' : 'error'  end

#error?Boolean

Returns:



39
# File 'lib/base_chip/track_state.rb', line 39

def error?   ; @state =~ /fault/   end

#fault!(f, s) ⇒ Object



35
# File 'lib/base_chip/track_state.rb', line 35

def fault!(  f,s); np(f,s); @state   = (@state =~ /error/) ? 'error && fault' : 'fault'  end

#fault?Boolean

Returns:



40
# File 'lib/base_chip/track_state.rb', line 40

def fault?   ; @state =~ /error/   end

#first_errorObject



56
# File 'lib/base_chip/track_state.rb', line 56

def first_error        ; @problem && @problem.to_s      end

#first_problem_fileObject



58
# File 'lib/base_chip/track_state.rb', line 58

def first_problem_file ; @problem && @problem.file      end

#first_signatureObject



57
# File 'lib/base_chip/track_state.rb', line 57

def first_signature    ; @problem && @problem.signature end

#np(file, signature) ⇒ Object



42
43
44
45
46
47
48
# File 'lib/base_chip/track_state.rb', line 42

def np(file,signature)
  return if @problem
  @problem = Problem.new
  @problem.file      = file
  @problem.signature = signature
  @problem
end

#pass!Object



32
# File 'lib/base_chip/track_state.rb', line 32

def pass!        ;          @state ||= 'pass'                                            end

#pass?Boolean

Returns:



37
# File 'lib/base_chip/track_state.rb', line 37

def pass?    ; @state == 'pass'    end

#take_state(thing) ⇒ Object



50
51
52
53
54
# File 'lib/base_chip/track_state.rb', line 50

def take_state(thing)
  return if @problem
  @state   = thing.state
  @problem = thing.problem
end

#warning!(f, s) ⇒ Object



33
# File 'lib/base_chip/track_state.rb', line 33

def warning!(f,s); np(f,s); @state   = 'warning' if @state.nil? or @state.pass?          end

#warning?Boolean

Returns:



38
# File 'lib/base_chip/track_state.rb', line 38

def warning? ; @state == 'warning' end