A base class for timing structures
# File Ruby/lib/mini_profiler/timer_struct.rb, line 7 def initialize(attrs={}) @attributes = attrs end
# File Ruby/lib/mini_profiler/timer_struct.rb, line 15 def [](name) attributes[name] end
# File Ruby/lib/mini_profiler/timer_struct.rb, line 19 def []=(name, val) attributes[name] = val self end
# File Ruby/lib/mini_profiler/timer_struct.rb, line 11 def attributes @attributes ||= {} end
# File Ruby/lib/mini_profiler/timer_struct.rb, line 24 def to_json(*a) # this does could take in an option hash, but the only interesting there is max_nesting. # if this becomes an option we could increase ::JSON.generate( @attributes, :max_nesting => 100 ) end