Sha256: 99fde135bc7c19f18a7515d4ad952792fa4e1ada813d9b55f0f50b59afaab4ab

Contents?: true

Size: 374 Bytes

Versions: 3

Compression:

Stored size: 374 Bytes

Contents

module Stopwatch
  class Event
    attr_accessor :query_count

    def initialize(event)
      @event = event
    end

    def template
      if @event.payload[:virtual_path]
        @event.payload[:virtual_path]
      else
        @event.payload[:identifier].gsub(/.*\/app\/views\//, "")
      end
    end

    def duration
      @event.duration.round(2)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
stopwatch-1.0.1 lib/stopwatch/event.rb
stopwatch-1.0.0 lib/stopwatch/event.rb
stopwatch-0.0.4 lib/stopwatch/event.rb