Sha256: decd2869c27bde577345e8238846b0124ce54682e6244d5d00e5d13e39e02eb7

Contents?: true

Size: 568 Bytes

Versions: 2

Compression:

Stored size: 568 Bytes

Contents

require "timber/util"
require "timber/event"
module Timber
  module Events
    # @private
    class TemplateRender < Timber::Event
      attr_reader :message, :name, :duration_ms

      def initialize(attributes)
        @name = attributes[:name]
        @duration_ms = attributes[:duration_ms]
        @message = attributes[:message]
      end

      def to_hash
        {
          template_rendered: Util::NonNilHashBuilder.build do |h|
            h.add(:name, name)
            h.add(:duration_ms, duration_ms)
          end
        }
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
timber-3.0.1 lib/timber/events/template_render.rb
timber-3.0.0 lib/timber/events/template_render.rb