Class: REXML::Formatters::OrderedAttributes

Inherits:
Pretty
  • Object
show all
Defined in:
lib/ruboto/core_ext/rexml.rb

Instance Method Summary collapse

Instance Method Details

#write_element(elm, out) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/ruboto/core_ext/rexml.rb', line 4

def write_element(elm, out)
  att = elm.attributes

  class <<att
    alias _each_attribute each_attribute

    def each_attribute(&b)
      to_enum(:_each_attribute).sort_by { |x| [x.prefix, x.name] }.each(&b)
    end
  end

  super(elm, out)
end