Module: QcMetric::QcState

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

Defined Under Namespace

Classes: State

Instance Method Summary collapse

Instance Method Details

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


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

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


13
14
15
# File 'app/models/qc_metric/qc_state.rb', line 13

def qc_state_object_called(name)
  @states[name]
end

#valid_statesObject


9
10
11
# File 'app/models/qc_metric/qc_state.rb', line 9

def valid_states
  @states.keys
end