Exception: DecisionAgent::InvalidTestDataError

Inherits:
Error
  • Object
show all
Defined in:
lib/decision_agent/errors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message = "Invalid test data", row_number: nil, errors: []) ⇒ InvalidTestDataError

Returns a new instance of InvalidTestDataError.



90
91
92
93
94
95
96
97
# File 'lib/decision_agent/errors.rb', line 90

def initialize(message = "Invalid test data", row_number: nil, errors: [])
  @row_number = row_number
  @errors = errors
  full_message = message.dup
  full_message += " (row #{row_number})" if row_number
  full_message += ": #{errors.join(', ')}" if errors.any?
  super(full_message)
end

Instance Attribute Details

#errorsObject (readonly)

Returns the value of attribute errors.



88
89
90
# File 'lib/decision_agent/errors.rb', line 88

def errors
  @errors
end

#row_numberObject (readonly)

Returns the value of attribute row_number.



88
89
90
# File 'lib/decision_agent/errors.rb', line 88

def row_number
  @row_number
end