Sha256: 8b1ccbdc34492746dd9c8765995b6e3830bcbf9d4eefc1bee3d8e3eac186eec7

Contents?: true

Size: 488 Bytes

Versions: 6

Compression:

Stored size: 488 Bytes

Contents

# frozen_string_literal: true

require "forwardable"

module Pennyworth
  module Presenters
    module System
      # Shapes a system error record for serialization.
      class Error
        extend Forwardable

        delegate %i[id description] => :record

        def initialize record
          @record = record
        end

        def label = record.name

        def subtitle = "#{label}: #{description}."

        private

        attr_reader :record
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
pennyworth-17.8.0 lib/pennyworth/presenters/system/error.rb
pennyworth-17.7.0 lib/pennyworth/presenters/system/error.rb
pennyworth-17.6.0 lib/pennyworth/presenters/system/error.rb
pennyworth-17.5.0 lib/pennyworth/presenters/system/error.rb
pennyworth-17.4.1 lib/pennyworth/presenters/system/error.rb
pennyworth-17.4.0 lib/pennyworth/presenters/system/error.rb