Sha256: c81c7c91955a8596b8a10964f85a57d3e68d68e330feea4b2bb062ef7756a0fe
Contents?: true
Size: 697 Bytes
Versions: 17
Compression:
Stored size: 697 Bytes
Contents
# frozen_string_literal: true module Pennyworth module Loaders # Loads an array of standard error records. class StandardError def initialize root: ::StandardError, model: Models::StandardError @root = root @model = model end def call(*) ObjectSpace.each_object(Class) .select { |klass| klass < root } .sort_by(&:name) .map do |error| file_path, line_number = Object.const_source_location error.name model[name: error, file_path:, line_number:] end end private attr_reader :root, :model end end end
Version data entries
17 entries across 17 versions & 1 rubygems