class Rack::Info::Config

Attributes

add_headers[RW]

You can create a configuration by providing a block to the constructor, or by setting values directly on a new instance:

Rack::Info::Config.new do |config|

config.add_html = false

end

config = Rack::Info::Config.new config.add_html = false

Configuration options (see README for explanation of options)

- data
- is_enabled
- add_headers
- add_html
- html_formatter
- insert_html_after
- path
add_html[RW]

You can create a configuration by providing a block to the constructor, or by setting values directly on a new instance:

Rack::Info::Config.new do |config|

config.add_html = false

end

config = Rack::Info::Config.new config.add_html = false

Configuration options (see README for explanation of options)

- data
- is_enabled
- add_headers
- add_html
- html_formatter
- insert_html_after
- path
data[RW]

You can create a configuration by providing a block to the constructor, or by setting values directly on a new instance:

Rack::Info::Config.new do |config|

config.add_html = false

end

config = Rack::Info::Config.new config.add_html = false

Configuration options (see README for explanation of options)

- data
- is_enabled
- add_headers
- add_html
- html_formatter
- insert_html_after
- path
html_formatter[RW]

You can create a configuration by providing a block to the constructor, or by setting values directly on a new instance:

Rack::Info::Config.new do |config|

config.add_html = false

end

config = Rack::Info::Config.new config.add_html = false

Configuration options (see README for explanation of options)

- data
- is_enabled
- add_headers
- add_html
- html_formatter
- insert_html_after
- path
insert_html_after[RW]

You can create a configuration by providing a block to the constructor, or by setting values directly on a new instance:

Rack::Info::Config.new do |config|

config.add_html = false

end

config = Rack::Info::Config.new config.add_html = false

Configuration options (see README for explanation of options)

- data
- is_enabled
- add_headers
- add_html
- html_formatter
- insert_html_after
- path
is_enabled[RW]

You can create a configuration by providing a block to the constructor, or by setting values directly on a new instance:

Rack::Info::Config.new do |config|

config.add_html = false

end

config = Rack::Info::Config.new config.add_html = false

Configuration options (see README for explanation of options)

- data
- is_enabled
- add_headers
- add_html
- html_formatter
- insert_html_after
- path
path[RW]

You can create a configuration by providing a block to the constructor, or by setting values directly on a new instance:

Rack::Info::Config.new do |config|

config.add_html = false

end

config = Rack::Info::Config.new config.add_html = false

Configuration options (see README for explanation of options)

- data
- is_enabled
- add_headers
- add_html
- html_formatter
- insert_html_after
- path

Public Class Methods

from(obj) click to toggle source
# File lib/rack/info/config.rb, line 24
def self.from(obj)
  obj.is_a?(self) ? obj : self.new {|cnf| cnf.data = obj }
end
new() { |self| ... } click to toggle source
# File lib/rack/info/config.rb, line 28
def initialize
  set_defaults
  yield self if block_given?
end

Public Instance Methods

add_headers?(env, rsp) click to toggle source
# File lib/rack/info/config.rb, line 37
def add_headers?(env, rsp)
  add_headers.respond_to?(:call) ? add_headers.call(env, rsp) : add_headers
end
add_html?(env, rsp) click to toggle source
# File lib/rack/info/config.rb, line 41
def add_html?(env, rsp)
  add_html.respond_to?(:call) ? add_html.call(env, rsp) : add_html
end
enabled?(env) click to toggle source
# File lib/rack/info/config.rb, line 33
def enabled?(env)
  is_enabled.respond_to?(:call) ? is_enabled.call(env) : is_enabled
end

Private Instance Methods

set_defaults() click to toggle source
# File lib/rack/info/config.rb, line 47
def set_defaults
  self.data = {}
  self.is_enabled = true
  self.add_headers = true
  self.add_html = true
  self.html_formatter = HTMLComment
  self.insert_html_after = '</body>'
  self.path = nil
end