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



5
6
7
8
9
10
11
12
13
# 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



19
20
21
# File 'app/models/qc_metric/qc_state.rb', line 19

def qc_state_object_called(name)
  @states[name]
end

#valid_statesObject



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

def valid_states
  @states.keys
end