Sha256: 7ec339feb6bd213dea7850ba1f69877627117006152952c4454b9f830ce5d6e0

Contents?: true

Size: 1.87 KB

Versions: 16

Compression:

Stored size: 1.87 KB

Contents

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

16 entries across 16 versions & 3 rubygems

Version Path
libxml-ruby-r19mingw-1.1.4 lib/libxml/attr_decl.rb
libxml-ruby-1.1.4 lib/libxml/attr_decl.rb
libxml-ruby-1.1.4-x86-mswin32-60 lib/libxml/attr_decl.rb
coupa-libxml-ruby-1.1.4 lib/libxml/attr_decl.rb
libxml-ruby-0.9.9-x86-mswin32-60 lib/libxml/attr_decl.rb
libxml-ruby-1.0.0-x86-mswin32-60 lib/libxml/attr_decl.rb
libxml-ruby-1.0.0 lib/libxml/attr_decl.rb
libxml-ruby-1.1.0 lib/libxml/attr_decl.rb
libxml-ruby-1.1.0-x86-mswin32-60 lib/libxml/attr_decl.rb
libxml-ruby-0.9.9 lib/libxml/attr_decl.rb
libxml-ruby-1.1.2 lib/libxml/attr_decl.rb
libxml-ruby-1.1.1-x86-mswin32-60 lib/libxml/attr_decl.rb
libxml-ruby-1.1.1 lib/libxml/attr_decl.rb
libxml-ruby-1.1.2-x86-mswin32-60 lib/libxml/attr_decl.rb
libxml-ruby-1.1.3 lib/libxml/attr_decl.rb
libxml-ruby-1.1.3-x86-mswin32-60 lib/libxml/attr_decl.rb