Sha256: 3cf4527b7ad453dbbc95b76a2bcae4e16361210e4ec7ab9a752ba787f3e7a31b

Contents?: true

Size: 631 Bytes

Versions: 29

Compression:

Stored size: 631 Bytes

Contents

class EachScope < ViewScope
  def initialize(handler, path, content)
    super(handler, path)
    @content, @variable_name = content.strip.split(/ as /)
  end
  
  def close_scope
    binding_number = @handler.scope[-2].binding_number
    @handler.scope[-2].binding_number += 1
    @path += "/__template/#{binding_number}"
    
    super
    
    @handler.html << "<!-- $#{binding_number} --><!-- $/#{binding_number} -->"
		@handler.scope.last.save_binding(binding_number, "lambda { |__p, __t, __c, __id| EachBinding.new(__p, __t, __c, __id, Proc.new { #{@content} }, #{@variable_name.inspect}, #{@path.inspect}) }")
    
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
volt-0.7.8 lib/volt/server/html_parser/each_scope.rb
volt-0.7.7 lib/volt/server/html_parser/each_scope.rb
volt-0.7.6 lib/volt/server/html_parser/each_scope.rb
volt-0.7.5 lib/volt/server/html_parser/each_scope.rb
volt-0.7.4 lib/volt/server/html_parser/each_scope.rb
volt-0.7.3 lib/volt/server/html_parser/each_scope.rb
volt-0.7.2 lib/volt/server/html_parser/each_scope.rb
volt-0.7.1 lib/volt/server/html_parser/each_scope.rb
volt-0.7.0 lib/volt/server/html_parser/each_scope.rb