Module: Card::Set::All::Error::JsonFormat

Extended by:
Card::Set::AbstractFormat
Defined in:
tmpsets/set/mod021-standard/all/error.rb

Instance Method Summary collapse

Instance Method Details

#error_listObject



78
79
80
81
82
# File 'tmpsets/set/mod021-standard/all/error.rb', line 78

def error_list
  card.errors.each_with_object([]) do |(field, message), list|
    list << { field: field, message: message }
  end
end

#format_error(error) ⇒ Object



74
75
76
# File 'tmpsets/set/mod021-standard/all/error.rb', line 74

def format_error error
  { error_status: error_status, errors: error }
end