Module: QcMetric::QcState

Included in:
QcMetric
Defined in:
app/models/qc_metric/qc_state.rb

Overview

rubocop:todo Style/Documentation

Defined Under Namespace

Classes: State

Instance Method Summary collapse

Instance Method Details

#new_state(name, options = {}) ⇒ Object


5
6
7
8
9
# File 'app/models/qc_metric/qc_state.rb', line 5

def new_state(name, options = {})
  @states ||= {}
  @states[name] =
    State.new(name, options.fetch(:automatic, true), options.fetch(:passed, true), options.fetch(:proceedable, true))
end

#qc_state_object_called(name) ⇒ Object


15
16
17
# File 'app/models/qc_metric/qc_state.rb', line 15

def qc_state_object_called(name)
  @states[name]
end

#valid_statesObject


11
12
13
# File 'app/models/qc_metric/qc_state.rb', line 11

def valid_states
  @states.keys
end