Module: Sinatra::Namespace::InstanceMethods

Defined in:
lib/sinatra/namespace.rb

Instance Method Summary collapse

Instance Method Details

#error_block!(*keys) ⇒ Object


139
140
141
142
143
144
145
# File 'lib/sinatra/namespace.rb', line 139

def error_block!(*keys)
  if block = keys.inject(nil) { |b,k| b ||= @namespace.errors[k] }
    instance_eval(&block)
  else
    super
  end
end

#settingsObject


131
132
133
# File 'lib/sinatra/namespace.rb', line 131

def settings
  @namespace
end

#template_cacheObject


135
136
137
# File 'lib/sinatra/namespace.rb', line 135

def template_cache
  super.fetch(:nested, @namespace) { Tilt::Cache.new }
end