Method: Jets::Router#scope

Defined in:
lib/jets/router.rb

#scope(options = {}) ⇒ Object



51
52
53
54
55
56
57
# File 'lib/jets/router.rb', line 51

def scope(options={})
  root_level = @scope.nil?
  @scope = root_level ? Scope.new(options) : @scope.new(options)
  yield
ensure
  @scope = @scope.parent if @scope
end