Module: ActionController::CustomBenchmarking::ClassMethods

Defined in:
lib/custom_benchmarks.rb

Instance Method Summary collapse

Instance Method Details

#custom_benchmark(*benchmark, &block) ⇒ Object



81
82
83
84
85
86
# File 'lib/custom_benchmarks.rb', line 81

def custom_benchmark(*benchmark, &block)
  if block_given?
    write_inheritable_attribute(:custom_benchmarks, 
      (read_inheritable_attribute(:custom_benchmarks) || []) << block)
  end
end

#custom_benchmarksObject



88
89
90
# File 'lib/custom_benchmarks.rb', line 88

def custom_benchmarks
  @custom_benchmarks ||= read_inheritable_attribute(:custom_benchmarks) || []
end