Sha256: 1c99d086beed4ddfd39a573b982779d6a2cb225084254e62c662ea305901fe16
Contents?: true
Size: 774 Bytes
Versions: 12
Compression:
Stored size: 774 Bytes
Contents
module Roqua module CoreApi class Base < ActiveInteraction::Base private def create_enum(headers, rows) row_class = Struct.new(*headers.map(&:to_sym)) rows.lazy.map { |row| row_class.new(*row) }.to_enum end def errors_to_object(response, obj) (response['errors'][obj.class.name.demodulize.underscore] || []).each do |attribute, errors| errors.each do |error| obj.errors.add(attribute.to_sym, error.to_sym) end end end def errors_to_usecase(response) (response['errors'] || []).each do |attribute, resp_errors| resp_errors.each do |error| errors.add(attribute.to_sym, error.to_sym) end end end end end end
Version data entries
12 entries across 12 versions & 1 rubygems