Sha256: 1dfcf669b2b00d9514bb0b109e7e9e927730965d0d1ecbd7e0a6f2901f9d51b8
Contents?: true
Size: 563 Bytes
Versions: 3
Compression:
Stored size: 563 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] || response['errors']).each do |attribute, errors| errors.each do |error| obj.errors.add(attribute.to_sym, error.to_sym) end end end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
roqua-core-api-0.0.39 | lib/roqua/core_api/base.rb |
roqua-core-api-0.0.38 | lib/roqua/core_api/base.rb |
roqua-core-api-0.0.37 | lib/roqua/core_api/base.rb |