Class: Rack::WebProfiler::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/rack/web_profiler/config.rb

Overview

Config

Constant Summary collapse

DEFAULT_COLLECTORS =
[
  Rack::WebProfiler::Collectors::RackCollector,
  Rack::WebProfiler::Collectors::RequestCollector,
  Rack::WebProfiler::Collectors::RubyCollector,
  Rack::WebProfiler::Collectors::TimeCollector,
].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



14
15
16
17
18
# File 'lib/rack/web_profiler/config.rb', line 14

def initialize
  @collectors = Rack::WebProfiler::Collectors.new

  load_defaults!
end

Instance Attribute Details

#collectorsObject

Returns the value of attribute collectors.



6
7
8
# File 'lib/rack/web_profiler/config.rb', line 6

def collectors
  @collectors
end

#tmp_dirObject

protected



30
31
32
# File 'lib/rack/web_profiler/config.rb', line 30

def tmp_dir
  @tmp_dir
end

Instance Method Details

#build!Object

Setup the configuration



21
22
23
24
25
26
# File 'lib/rack/web_profiler/config.rb', line 21

def build!
  unless block_given?
    # @todo raise an Exception if no block given
  end
  instance_eval(&Proc.new)
end