Sha256: eb3b5f2526f0531e286a8264321d7116b1444c4dcc89288fd6b81edfe55bc691

Contents?: true

Size: 566 Bytes

Versions: 7

Compression:

Stored size: 566 Bytes

Contents

# frozen_string_literal: true

require "refinements/arrays"

module Pennyworth
  module Presenters
    # Renders a standard error into a compatible format for use in Alfred script filters.
    class StandardError
      using Refinements::Arrays

      def initialize record
        @record = record
      end

      def id = label

      def label = record.name.to_s

      def path = file_path.empty? ? "" : [file_path, record.line_number].compress!.join(":")

      private

      attr_reader :record

      def file_path = record.file_path.to_s
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
pennyworth-13.8.0 lib/pennyworth/presenters/standard_error.rb
pennyworth-13.7.0 lib/pennyworth/presenters/standard_error.rb
pennyworth-13.6.0 lib/pennyworth/presenters/standard_error.rb
pennyworth-13.5.0 lib/pennyworth/presenters/standard_error.rb
pennyworth-13.4.0 lib/pennyworth/presenters/standard_error.rb
pennyworth-13.3.0 lib/pennyworth/presenters/standard_error.rb
pennyworth-13.2.0 lib/pennyworth/presenters/standard_error.rb