File: attributes.rb

package info (click to toggle)
ruby-libxml 5.0.5-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,804 kB
  • sloc: xml: 18,263; ansic: 7,669; ruby: 5,809; makefile: 6
file content (14 lines) | stat: -rw-r--r-- 210 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# encoding: UTF-8

module LibXML
  module XML
    class Attributes
      def to_h
        inject({}) do |hash, attr|
          hash[attr.name] = attr.value
          hash
        end
      end
    end
  end
end