Sha256: cd0dfc951f49eb5fc19db9015c327109cf9f3e0d047fd107e9c6ad19521464d1
Contents?: true
Size: 705 Bytes
Versions: 24
Compression:
Stored size: 705 Bytes
Contents
# frozen_string_literal: true module Pennyworth module Loaders # Loads an array of standard error records. class StandardErrors def initialize root: StandardError, model: Models::StandardError @root = root @model = model end def call _omit = nil 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
24 entries across 24 versions & 1 rubygems