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.8.5 lib/volt/server/html_parser/each_scope.rb
volt-0.8.4 lib/volt/server/html_parser/each_scope.rb
volt-0.8.3 lib/volt/server/html_parser/each_scope.rb
volt-0.8.2 lib/volt/server/html_parser/each_scope.rb
volt-0.8.1 lib/volt/server/html_parser/each_scope.rb
volt-0.8.0 lib/volt/server/html_parser/each_scope.rb
volt-0.7.23 lib/volt/server/html_parser/each_scope.rb
volt-0.7.22 lib/volt/server/html_parser/each_scope.rb
volt-0.7.21 lib/volt/server/html_parser/each_scope.rb
volt-0.7.20 lib/volt/server/html_parser/each_scope.rb
volt-0.7.19 lib/volt/server/html_parser/each_scope.rb
volt-0.7.18 lib/volt/server/html_parser/each_scope.rb
volt-0.7.17 lib/volt/server/html_parser/each_scope.rb
volt-0.7.16 lib/volt/server/html_parser/each_scope.rb
volt-0.7.15 lib/volt/server/html_parser/each_scope.rb
volt-0.7.14 lib/volt/server/html_parser/each_scope.rb
volt-0.7.13 lib/volt/server/html_parser/each_scope.rb
volt-0.7.12 lib/volt/server/html_parser/each_scope.rb
volt-0.7.10 lib/volt/server/html_parser/each_scope.rb
volt-0.7.9 lib/volt/server/html_parser/each_scope.rb