Method: REXML::Attributes#length
- Defined in:
- lib/rexml/element.rb
#length ⇒ Object Also known as: size
Returns the number of attributes the owning Element contains.
doc = Document "<a x='1' y='2' foo:x='3'/>"
doc.root.attributes.length #-> 3
996 997 998 999 1000 |
# File 'lib/rexml/element.rb', line 996 def length c = 0 each_attribute { c+=1 } c end |