class RDStation::ErrorHandler::ConflictingField

Constants

ERROR_CODE

Attributes

errors[R]

Public Class Methods

new(errors) click to toggle source
# File lib/rdstation/error_handler/conflicting_field.rb, line 8
def initialize(errors)
  @errors = errors
end

Public Instance Methods

raise_error() click to toggle source
# File lib/rdstation/error_handler/conflicting_field.rb, line 12
def raise_error
  return if conflicting_field_errors.empty?
  raise RDStation::Error::ConflictingField, conflicting_field_errors.first
end

Private Instance Methods

conflicting_field_errors() click to toggle source
# File lib/rdstation/error_handler/conflicting_field.rb, line 19
def conflicting_field_errors
  errors.select { |error| error['error_type'] == ERROR_CODE }
end