Sha256: 6bb3a2545b55fd8d7f415a2dd5ef620c78aaa98de87ac9b08628de69c7695a4c
Contents?: true
Size: 805 Bytes
Versions: 23
Compression:
Stored size: 805 Bytes
Contents
# frozen_string_literal: true 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
23 entries across 23 versions & 1 rubygems