Module: ActionController::CustomBenchmarking::ClassMethods

Defined in:
lib/custom_benchmarks.rb

Instance Method Summary collapse

Instance Method Details

#custom_benchmark(*benchmark, &block) ⇒ Object



90
91
92
93
94
95
96
97
# File 'lib/custom_benchmarks.rb', line 90

def custom_benchmark(*benchmark, &block)
  #return if ENV['RAILS_ENV'] == "test"

  if block_given?
    write_inheritable_attribute(:custom_benchmarks,
      (read_inheritable_attribute(:custom_benchmarks) || []) << block)
  end
end

#custom_benchmarksObject



99
100
101
# File 'lib/custom_benchmarks.rb', line 99

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