Exception: Trailblazer::Activity::Adds::IndexError

Inherits:
IndexError
  • Object
show all
Defined in:
lib/trailblazer/activity/adds.rb

Overview

Insert

Instance Method Summary collapse

Constructor Details

#initialize(sequence, step_id) ⇒ IndexError

Returns a new instance of IndexError.



145
146
147
148
149
150
151
152
153
# File 'lib/trailblazer/activity/adds.rb', line 145

def initialize(sequence, step_id)
  valid_ids = sequence.to_a.collect { |row| row.id.inspect }

  message = "\n" \
    "\e[31m#{step_id.inspect} is not a valid step ID. Did you mean any of these ?\e[0m\n" \
    "\e[32m#{valid_ids.join("\n")}\e[0m"

  super(message)
end