Sha256: 24f8e59954310ba5aa2b51603c05d7056a7db4d43cbe193540693e7e72ef4554
Contents?: true
Size: 777 Bytes
Versions: 8
Compression:
Stored size: 777 Bytes
Contents
module Rack class MiniProfiler module TimerStruct # A base class for timing structures class Base 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) # 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 def as_json(options = nil) @attributes.as_json(options) end end end end end
Version data entries
8 entries across 8 versions & 2 rubygems