Sha256: 870b5a5a0ed36d33351af848971b0f502ecec78263d84ab8a55062a959dcbf69

Contents?: true

Size: 672 Bytes

Versions: 9

Compression:

Stored size: 672 Bytes

Contents

require 'sass/tree/node'

module Sass::Tree
  class ForNode < Node
    def initialize(var, from, to, exclusive, options)
      @var = var
      @from = from
      @to = to
      @exclusive = exclusive
      super(options)
    end

    protected

    def _perform(environment)
      from = @from.perform(environment).to_i
      to = @to.perform(environment).to_i
      range = Range.new(from, to, @exclusive)

      children = []
      range.each do |i|
        environment = Sass::Environment.new(environment)
        environment.set_local_var(@var, Sass::Script::Number.new(i))
        children += perform_children(environment)
      end
      children
    end
  end
end

Version data entries

9 entries across 9 versions & 5 rubygems

Version Path
honkster-haml-2.1.0 lib/sass/tree/for_node.rb
honkster-haml-2.1.1 lib/sass/tree/for_node.rb
jwhitmire-haml-2.1.0.1 lib/sass/tree/for_node.rb
jwhitmire-haml-2.1.0.2 lib/sass/tree/for_node.rb
jwhitmire-haml-2.1.0.3 lib/sass/tree/for_node.rb
wireframe-haml-2.1.0 lib/sass/tree/for_node.rb
wireframe-haml-2.1.1 lib/sass/tree/for_node.rb
merbjedi-haml-2.1.0 lib/sass/tree/for_node.rb
spree-0.8.0 vendor/gems/haml-2.1.0/lib/sass/tree/for_node.rb