Sha256: f61a814e5f1518b2b6d14484e14f2a9bdc8460d17575f0f3412abfe7b75ae491
Contents?: true
Size: 613 Bytes
Versions: 20
Compression:
Stored size: 613 Bytes
Contents
# frozen_string_literal: true require 'shopify_cli' module Extension module Tasks module Converters module ValidationErrorConverter FIELD_FIELD = 'field' MESSAGE_FIELD = 'message' def self.from_array(context, errors) return [] if errors.nil? context.abort(context.message('tasks.errors.parse_error')) unless errors.is_a?(Array) errors.map do |error| Models::ValidationError.new( field: error[FIELD_FIELD], message: error[MESSAGE_FIELD] ) end end end end end end
Version data entries
20 entries across 20 versions & 1 rubygems