Sha256: 0e968523d1d7d324238ca84a4ea6690a4c97eab16cfff6a5ca64f3271fbd07f7

Contents?: true

Size: 1.89 KB

Versions: 72

Compression:

Stored size: 1.89 KB

Contents

# encoding: UTF-8

module LibXML
  module XML
    class AttrDecl
      include Enumerable

      # call-seq:
      #   attr_decl.child -> nil
      #
      # Obtain this attribute declaration's child attribute(s).
      # It will always be nil.
      def child
        nil
      end

      # call-seq:
      #    attr_decl.child? -> (true|false)
      #
      # Returns whether this attribute declaration has child attributes.
      #
      def child?
        not self.children.nil?
      end

      # call-seq:
      #    attr_decl.doc? -> (true|false)
      #
      # Determine whether this attribute declaration is associated with an
      # XML::Document.
      def doc?
        not self.doc.nil?
      end

      # call-seq:
      #    attr_decl.next? -> (true|false)
      #
      # Determine whether there is a next attribute declaration.
      def next?
        not self.next.nil?
      end

      # call-seq:
      #    attr_decl.parent? -> (true|false)
      #
      # Determine whether this attribute declaration has a parent .
      def parent?
        not self.parent.nil?
      end

      # call-seq:
      #    attr_decl.prev? -> (true|false)
      #
      # Determine whether there is a previous attribute declaration.
      def prev?
        not self.prev.nil?
      end

      # call-seq:
      #    attr_decl.node_type_name -> 'attribute declaration'
      #
      # Returns this attribute declaration's node type name.
      def node_type_name
        if node_type == Node::ATTRIBUTE_DECL
          'attribute declaration'
        else
          raise(UnknownType, "Unknown node type: %n", node.node_type);
        end
      end

      # call-seq:
      #    attr_decl.to_s -> string
      #
      # Returns a string representation of this attribute declaration.
      def to_s
        "#{name} = #{value}"
      end
    end
  end
end

Version data entries

72 entries across 72 versions & 1 rubygems

Version Path
libxml-ruby-5.0.3-x64-mingw-ucrt lib/libxml/attr_decl.rb
libxml-ruby-5.0.3 lib/libxml/attr_decl.rb
libxml-ruby-5.0.2-x64-mingw-ucrt lib/libxml/attr_decl.rb
libxml-ruby-5.0.2 lib/libxml/attr_decl.rb
libxml-ruby-5.0.1-x64-mingw-ucrt lib/libxml/attr_decl.rb
libxml-ruby-5.0.1 lib/libxml/attr_decl.rb
libxml-ruby-5.0.0-x64-mingw-ucrt lib/libxml/attr_decl.rb
libxml-ruby-5.0.0 lib/libxml/attr_decl.rb
libxml-ruby-4.1.2-x64-mingw-ucrt lib/libxml/attr_decl.rb
libxml-ruby-4.1.2 lib/libxml/attr_decl.rb
libxml-ruby-4.1.1-x64-mingw-ucrt lib/libxml/attr_decl.rb
libxml-ruby-4.1.1 lib/libxml/attr_decl.rb
libxml-ruby-4.1.0 lib/libxml/attr_decl.rb
libxml-ruby-4.0.0-x64-mingw-ucrt lib/libxml/attr_decl.rb
libxml-ruby-4.0.0 lib/libxml/attr_decl.rb
libxml-ruby-3.2.4-x64-mingw-ucrt lib/libxml/attr_decl.rb
libxml-ruby-3.2.4 lib/libxml/attr_decl.rb
libxml-ruby-3.2.3-x64-mingw-ucrt lib/libxml/attr_decl.rb
libxml-ruby-3.2.3 lib/libxml/attr_decl.rb
libxml-ruby-3.2.2-x64-mingw32 lib/libxml/attr_decl.rb