class Arrays::ArrayCreateTag

Public Instance Methods

parse(tokens) click to toggle source
Calls superclass method
# File lib/liquid-arrays/array_create_tag.rb, line 5
def parse(tokens)
  super
  catch do
    parser = AttributeParser.new(@parse_context, 'array', @markup)
    @array_name = parser.consume_required_attribute('array', :id)
    @items = parser.consume_attribute('items', :array)
    parser.finish
  end
end
render(context) click to toggle source
# File lib/liquid-arrays/array_create_tag.rb, line 15
def render(context)
  context.scopes.last[@array_name] = @items.nil? ?
    [] : @items.render(context)
  ''
end