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


4
5
6
7
8
# 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


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

def qc_state_object_called(name)
  @states[name]
end

#valid_statesObject


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

def valid_states
  @states.keys
end