Sha256: 9642022d6b95a1d5368d75790efd92db38c851fb80954be38da58e80315267dc
Contents?: true
Size: 697 Bytes
Versions: 24
Compression:
Stored size: 697 Bytes
Contents
# frozen_string_literal: true module Pennyworth module Loaders module System # Loads an array of system error records. class Errors def initialize errno: Errno, model: Models::System::Error @errno = errno @model = model end def call _omit = nil errno.constants .map { |name| errno.const_get name } .uniq .sort_by { |error| error::Errno } .map do |error| model[id: error::Errno, name: error.name, description: error.exception.message] end end private attr_reader :errno, :model end end end end
Version data entries
24 entries across 24 versions & 1 rubygems