Sha256: f612ce95dc09400ed5e62e1dc59c84a1a901d0947d70d67fa5c8ae2c15cc54d9

Contents?: true

Size: 649 Bytes

Versions: 13

Compression:

Stored size: 649 Bytes

Contents

module LibXML # :nodoc:
  module XML # :nodoc:

    class Node
      alias_method :element_name, :name
      alias_method :element_name=, :name=
    end

    class Attributes
      # Helper method for removing attributes
      def remove(name)
        attribute = get_attribute(name.to_s)
        attribute.remove! if attribute
      end

      alias_method :old_hash_set, :[]= # :nodoc:
      def []=(name, val)
        val.nil? ? remove(name.to_s) : old_hash_set(name.to_s, val.to_s)
      end

      alias_method :old_hash_get, :[] # :nodoc:
      def [](name)
        old_hash_get name.to_s
      end
    end #Attributes

  end #XML
end #LibXML

Version data entries

13 entries across 13 versions & 2 rubygems

Version Path
sprsquish-blather-0.2.3 lib/blather/core_ext/libxml.rb
sprsquish-blather-0.3.0 lib/blather/core_ext/libxml.rb
sprsquish-blather-0.3.1 lib/blather/core_ext/libxml.rb
sprsquish-blather-0.3.2 lib/blather/core_ext/libxml.rb
sprsquish-blather-0.3.3 lib/blather/core_ext/libxml.rb
sprsquish-blather-0.3.4 lib/blather/core_ext/libxml.rb
blather-0.2.2 lib/blather/core_ext/libxml.rb
blather-0.3.1 lib/blather/core_ext/libxml.rb
blather-0.2.3 lib/blather/core_ext/libxml.rb
blather-0.3.0 lib/blather/core_ext/libxml.rb
blather-0.3.4 lib/blather/core_ext/libxml.rb
blather-0.3.3 lib/blather/core_ext/libxml.rb
blather-0.3.2 lib/blather/core_ext/libxml.rb