Class: Rack::MiniProfiler::Config
- Inherits:
-
Object
- Object
- Rack::MiniProfiler::Config
- Defined in:
- lib/mini_profiler/config.rb
Instance Attribute Summary collapse
-
#authorization_mode ⇒ Object
Returns the value of attribute authorization_mode.
-
#auto_inject ⇒ Object
Returns the value of attribute auto_inject.
-
#backtrace_filter ⇒ Object
Returns the value of attribute backtrace_filter.
-
#backtrace_remove ⇒ Object
Returns the value of attribute backtrace_remove.
-
#base_url_path ⇒ Object
Returns the value of attribute base_url_path.
-
#position ⇒ Object
Returns the value of attribute position.
-
#pre_authorize_cb ⇒ Object
Returns the value of attribute pre_authorize_cb.
-
#skip_paths ⇒ Object
Returns the value of attribute skip_paths.
-
#skip_schema_queries ⇒ Object
Returns the value of attribute skip_schema_queries.
-
#storage ⇒ Object
Returns the value of attribute storage.
-
#storage_instance ⇒ Object
Returns the value of attribute storage_instance.
-
#storage_options ⇒ Object
Returns the value of attribute storage_options.
-
#use_existing_jquery ⇒ Object
Returns the value of attribute use_existing_jquery.
-
#user_provider ⇒ Object
Returns the value of attribute user_provider.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#authorization_mode ⇒ Object
Returns the value of attribute authorization_mode.
15 16 17 |
# File 'lib/mini_profiler/config.rb', line 15 def @authorization_mode end |
#auto_inject ⇒ Object
Returns the value of attribute auto_inject.
15 16 17 |
# File 'lib/mini_profiler/config.rb', line 15 def auto_inject @auto_inject end |
#backtrace_filter ⇒ Object
Returns the value of attribute backtrace_filter.
15 16 17 |
# File 'lib/mini_profiler/config.rb', line 15 def backtrace_filter @backtrace_filter end |
#backtrace_remove ⇒ Object
Returns the value of attribute backtrace_remove.
15 16 17 |
# File 'lib/mini_profiler/config.rb', line 15 def backtrace_remove @backtrace_remove end |
#base_url_path ⇒ Object
Returns the value of attribute base_url_path.
15 16 17 |
# File 'lib/mini_profiler/config.rb', line 15 def base_url_path @base_url_path end |
#position ⇒ Object
Returns the value of attribute position.
15 16 17 |
# File 'lib/mini_profiler/config.rb', line 15 def position @position end |
#pre_authorize_cb ⇒ Object
Returns the value of attribute pre_authorize_cb.
15 16 17 |
# File 'lib/mini_profiler/config.rb', line 15 def @pre_authorize_cb end |
#skip_paths ⇒ Object
Returns the value of attribute skip_paths.
15 16 17 |
# File 'lib/mini_profiler/config.rb', line 15 def skip_paths @skip_paths end |
#skip_schema_queries ⇒ Object
Returns the value of attribute skip_schema_queries.
15 16 17 |
# File 'lib/mini_profiler/config.rb', line 15 def skip_schema_queries @skip_schema_queries end |
#storage ⇒ Object
Returns the value of attribute storage.
15 16 17 |
# File 'lib/mini_profiler/config.rb', line 15 def storage @storage end |
#storage_instance ⇒ Object
Returns the value of attribute storage_instance.
15 16 17 |
# File 'lib/mini_profiler/config.rb', line 15 def storage_instance @storage_instance end |
#storage_options ⇒ Object
Returns the value of attribute storage_options.
15 16 17 |
# File 'lib/mini_profiler/config.rb', line 15 def @storage_options end |
#use_existing_jquery ⇒ Object
Returns the value of attribute use_existing_jquery.
15 16 17 |
# File 'lib/mini_profiler/config.rb', line 15 def use_existing_jquery @use_existing_jquery end |
#user_provider ⇒ Object
Returns the value of attribute user_provider.
15 16 17 |
# File 'lib/mini_profiler/config.rb', line 15 def user_provider @user_provider end |
Class Method Details
.attr_accessor(*vars) ⇒ Object
5 6 7 8 9 |
# File 'lib/mini_profiler/config.rb', line 5 def self.attr_accessor(*vars) @attributes ||= [] @attributes.concat vars super(*vars) end |
.attributes ⇒ Object
11 12 13 |
# File 'lib/mini_profiler/config.rb', line 11 def self.attributes @attributes end |
.default ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/mini_profiler/config.rb', line 19 def self.default new.instance_eval { @auto_inject = true # automatically inject on every html page @base_url_path = "/mini-profiler-resources/" # called prior to rack chain, to ensure we are allowed to profile @pre_authorize_cb = lambda {|env| true} # called after rack chain, to ensure we are REALLY allowed to profile @position = 'left' # Where it is displayed @skip_schema_queries = false @storage = MiniProfiler::MemoryStore @user_provider = Proc.new{|env| Rack::Request.new(env).ip} @authorization_mode = :allow_all @use_existing_jquery = false self } end |
Instance Method Details
#merge!(config) ⇒ Object
38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/mini_profiler/config.rb', line 38 def merge!(config) return unless config if Hash === config config.each{|k,v| instance_variable_set "@#{k}",v} else self.class.attributes.each{ |k| v = config.send k instance_variable_set "@#{k}", v if v } end end |