class REXML::Attributes
def each_attribute # :yields: attribute
[REXML::Attribute, att='<']
[REXML::Attribute, bar:att='2']
[REXML::Attribute, foo:att='1']
Output:
end
p [attr.class, attr]
ele.attributes.each_attribute do |attr|
ele = d.root.elements['//ele'] # =>
d = REXML::Document.new(xml_string)
EOT
xml_string = <<-EOT
Calls the given block with each \REXML::Attribute object:
each_attribute {|attr| ... }
:call-seq:
def each_attribute # :yields: attribute return to_enum(__method__) unless block_given? each_value do |val| if val.kind_of? Attribute yield val else val.each_value { |atr| yield atr } end end end