lib/volt/server/html_parser/attribute_scope.rb
# Take the attributes and create any bindings
Take the attributes and create any bindings
Take the attributes and create any bindings
def process_attribute(tag_name, attributes, attribute_name, value)
    parts = value.split(/(\{[^\}]+\})/).reject(&:blank?)
    binding_count = parts.count {|p| p[0] == '{' && p[-1] == '}'}
    if binding_count > 0
      id = add_id_to_attributes(attributes)
      if parts.size > 1
        add_multiple_attribute(tag_name, id, attribute_name, parts, value)
      elsif parts.size == 1 && binding_count == 1
        add_single_attribute(id, attribute_name, parts)
      end
      attributes.delete(attribute_name)
    end
  end
def process_attribute ( tag_name , attributes , attribute_name , value ) parts = value . split ( / ( \{ [^ \} ]+ \} ) / ) . reject ( & :blank? ) binding_count = parts . count { | p | p [ 0 ] == '{' && p [ - 1 ] == '}' } if binding_count > 0 id = add_id_to_attributes ( attributes ) if parts . size > 1 add_multiple_attribute ( tag_name , id , attribute_name , parts , value ) elsif parts . size == 1 && binding_count == 1 add_single_attribute ( id , attribute_name , parts ) end attributes . delete ( attribute_name ) end end
Take the attributes and create any bindings
Take the attributes and create any bindings
# if this attribute has bindings # Setup an id # Multiple bindings # A single binding # Remove the attribute
tag_name
attributes
attribute_name
value