lib/volt/server/html_parser/view_scope.rb
# Called when this scope should be closed out
Called when this scope should be closed out
Called when this scope should be closed out
def close_scope(pop=true)
    if pop
      scope = @handler.scope.pop
    else
      scope = @handler.last
    end
    raise "template path already exists: #{scope.path}" if @handler.templates[scope.path]
    template = {
      'html' => scope.html
    }
    if scope.bindings.size > 0
      template['bindings'] = scope.bindings
    end
    @handler.templates[scope.path] = template
  end
def close_scope ( pop = true ) if pop scope = @handler . scope . pop else scope = @handler . last end raise "template path already exists: #{scope.path}" if @handler . templates [ scope . path ] template = { 'html' => scope . html } if scope . bindings . size > 0 template [ 'bindings' ] = scope . bindings end @handler . templates [ scope . path ] = template end
Called when this scope should be closed out
Called when this scope should be closed out
# Add the bindings if there are any
pop