Sha256: ecea3e6eb992516757c3d5febaaaf223d1d11fa0d18737401841a1c76392ac50

Contents?: true

Size: 585 Bytes

Versions: 1

Compression:

Stored size: 585 Bytes

Contents

module Timber
  module Contexts
    module TemplateRenders
      class ActionView < TemplateRender
        attr_reader :event

        def initialize(event)
          # Initialize should be as fast as possible since it is executed inline.
          # Hence the lazy methods below.
          @event = event
          super()
        end

        def name
          @name ||= payload[:identifier]
        end

        def time_ms
          @time_ms ||= event.duration
        end

        private
          def payload
            event.payload
          end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
timberio-1.0.0.beta1 lib/timber/contexts/template_renders/action_view.rb