class Rack::ServerPages::Config
Attributes
filter[R]
Public Class Methods
hash_accessor(*names)
click to toggle source
# File lib/rack/server_pages.rb, line 141 def self.hash_accessor(*names) names.each do |name| define_method("#{name}=") { |v| self[name] = v } define_method(name) { self[name] } end end
new()
click to toggle source
Calls superclass method
# File lib/rack/server_pages.rb, line 154 def initialize super self[:default_charset] ||= 'utf-8' self[:view_path] ||= %w(views public) @helpers = [] @filter = Filter.new end
Public Instance Methods
helpers(*args, &block)
click to toggle source
# File lib/rack/server_pages.rb, line 174 def helpers(*args, &block) @helpers << block if block_given? @helpers.concat args unless args.empty? @helpers end
show_exceptions?()
click to toggle source
# File lib/rack/server_pages.rb, line 162 def show_exceptions? if self[:show_exceptions].nil? ENV['RACK_ENV'].nil? || (ENV['RACK_ENV'] == 'development') else self[:show_exceptions] end end
view_paths()
click to toggle source
# File lib/rack/server_pages.rb, line 170 def view_paths (v = self[:view_path]).is_a?(Enumerable) ? v : [v.to_s] end