Sha256: eb7b1698e3aba669050bd4cac0619303e39e879d10e7e58a78ad60d22f00a4af

Contents?: true

Size: 290 Bytes

Versions: 5

Compression:

Stored size: 290 Bytes

Contents

module RailsPerformance
  module Models
    class BaseRecord
      def value
        @value ||= JSON.parse(@json || "{}")
      end

      def duration
        value["duration"]
      end

      private

      def ms(e)
        e.to_f.round(1).to_s + " ms" if e
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rails_performance-1.4.1 lib/rails_performance/models/base_record.rb
rails_performance-1.4.1.alpha1 lib/rails_performance/models/base_record.rb
rails_performance-1.4.0 lib/rails_performance/models/base_record.rb
rails_performance-1.4.0.alpha5 lib/rails_performance/models/base_record.rb
rails_performance-1.4.0.alpha4 lib/rails_performance/models/base_record.rb