Method: ETL#reverse_to

Defined in:
lib/etl/etl.rb

#reverse_to(state) ⇒ Object

Raises:

  • (ArgumentError)


184
185
186
187
188
189
190
# File 'lib/etl/etl.rb', line 184

def reverse_to(state)
  raise ArgumentError, "State must be one of #{VALID_STATES.inspect}" unless VALID_STATES.include?(state)
  loc = VALID_STATES.index(state)
  possible_states = VALID_STATES[0..loc]
  raise "Cannot reverse to a state that hasn't been acheived yet." unless possible_states.include?(state)
  @state = state
end