instance method
on_start_element
Ruby on Rails 7.1.6
Since v2.3.18Signature
on_start_element(name, attrs = {})
No documentation comment.
Parameters
-
namereq -
attrsopt = {}
Source
# File activesupport/lib/active_support/xml_mini/libxmlsax.rb, line 35
def on_start_element(name, attrs = {})
new_hash = { CONTENT_KEY => +"" }.merge!(attrs)
new_hash[HASH_SIZE_KEY] = new_hash.size + 1
case current_hash[name]
when Array then current_hash[name] << new_hash
when Hash then current_hash[name] = [current_hash[name], new_hash]
when nil then current_hash[name] = new_hash
end
@hash_stack.push(new_hash)
end
Defined in activesupport/lib/active_support/xml_mini/libxmlsax.rb line 35
· View on GitHub
· Improve this page
· Find usages on GitHub