Method: Liquid::For#initialize

Defined in:
lib/liquid/tags/for.rb

#initialize(tag_name, markup, tokens) ⇒ For

Returns a new instance of For.



47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/liquid/tags/for.rb', line 47

def initialize(tag_name, markup, tokens)
  if markup =~ Syntax
    @variable_name = $1
    @collection_name = $2
    @name = "#{$1}-#{$2}"           
    @reversed = $3             
    @attributes = {}
    markup.scan(TagAttributes) do |key, value|
      @attributes[key] = value
    end        
  else
    raise SyntaxError.new("Syntax Error in 'for loop' - Valid syntax: for [item] in [collection]")
  end

  super
end