Sha256: db2637cda536edbd5fea7c558171fe1bd7fc7905f784fc9f4547b0758cec3f4e

Contents?: true

Size: 457 Bytes

Versions: 14

Compression:

Stored size: 457 Bytes

Contents

module Rack
  class MiniProfiler

    # A base class for timing structures
    class TimerStruct

      def initialize(attrs={})
        @attributes = attrs
      end

      def attributes
        @attributes ||= {}
      end

      def [](name)
        attributes[name]
      end

      def []=(name, val)
        attributes[name] = val
        self
      end

      def to_json(*a)
        ::JSON.generate(@attributes, a[0])
      end

    end

  end
end

Version data entries

14 entries across 14 versions & 2 rubygems

Version Path
rack-mini-profiler-0.1.9 lib/mini_profiler/timer_struct.rb
rack-mini-profiler-0.1.8 lib/mini_profiler/timer_struct.rb
miniprofiler-0.1.7.4 lib/mini_profiler/timer_struct.rb
miniprofiler-0.1.7.3 lib/mini_profiler/timer_struct.rb
miniprofiler-0.1.7.2 lib/mini_profiler/timer_struct.rb
miniprofiler-0.1.7.1 lib/mini_profiler/timer_struct.rb
rack-mini-profiler-0.1.7 lib/mini_profiler/timer_struct.rb
rack-mini-profiler-0.1.6 lib/mini_profiler/timer_struct.rb
rack-mini-profiler-0.1.5 lib/mini_profiler/timer_struct.rb
rack-mini-profiler-0.1.4 lib/mini_profiler/timer_struct.rb
rack-mini-profiler-0.1.3 lib/mini_profiler/timer_struct.rb
rack-mini-profiler-0.1.2 lib/mini_profiler/timer_struct.rb
rack-mini-profiler-0.1.1 lib/mini_profiler/timer_struct.rb
rack-mini-profiler-0.1 lib/mini_profiler/timer_struct.rb