Module: Sequencescape::Behaviour::StateDriven
Class Method Summary collapse
-
.included(base) ⇒ Object
rubocop:todo Metrics/MethodLength.
Class Method Details
.included(base) ⇒ Object
rubocop:todo Metrics/MethodLength
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/sequencescape/behaviour/state_driven.rb', line 3 def self.included(base) # rubocop:todo Metrics/MethodLength base.class_eval do attribute_reader :state # Define a few default states %i[pending started passed failed cancelled unknown qc_complete].each do |state| line = __LINE__ + 1 class_eval(" def #{state}? state == #{state.to_s.inspect} end ", __FILE__, line) end end end |