diff --git a/lib/oga/xml/attribute.rb b/lib/oga/xml/attribute.rb index e42fe96..7de6fd7 100644 --- a/lib/oga/xml/attribute.rb +++ b/lib/oga/xml/attribute.rb @@ -3,19 +3,17 @@ module Oga ## # Class for storing information about a single XML attribute. # - # @!attribute [rw] name - # The name of the attribute. - # @return [String] - # - # @!attribute [rw] namespace_name - # @return [String] - # - # @!attribute [r] element - # The element this attribute belongs to. - # @return [Oga::XML::Element] - # class Attribute - attr_accessor :name, :namespace_name, :element + # The name of the attribute. + # @return [String] + attr_accessor :name + + # @return [String] + attr_accessor :namespace_name + + # The element this attribute belongs to. + # @return [Oga::XML::Element] + attr_accessor :element ## # The default namespace available to all attributes. This namespace can diff --git a/lib/oga/xml/character_node.rb b/lib/oga/xml/character_node.rb index 2c80aab..7bcf180 100644 --- a/lib/oga/xml/character_node.rb +++ b/lib/oga/xml/character_node.rb @@ -4,10 +4,8 @@ module Oga # Base class for nodes that represent a text-like value such as Text and # Comment nodes. # - # @!attribute [rw] text - # @return [String] - # class CharacterNode < Node + # @return [String] attr_accessor :text ## diff --git a/lib/oga/xml/doctype.rb b/lib/oga/xml/doctype.rb index 419c2ac..e83f6d6 100644 --- a/lib/oga/xml/doctype.rb +++ b/lib/oga/xml/doctype.rb @@ -3,28 +3,26 @@ module Oga ## # Class used for storing information about Doctypes. # - # @!attribute [rw] name - # The name of the doctype (e.g. "HTML"). - # @return [String] - # - # @!attribute [rw] type - # The type of the doctype (e.g. "PUBLIC"). - # @return [String] - # - # @!attribute [rw] public_id - # The public ID of the doctype. - # @return [String] - # - # @!attribute [rw] system_id - # The system ID of the doctype. - # @return [String] - # - # @!attribute [rw] inline_rules - # The inline doctype rules. - # @return [String] - # class Doctype - attr_accessor :name, :type, :public_id, :system_id, :inline_rules + # The name of the doctype (e.g. "HTML"). + # @return [String] + attr_accessor :name + + # The type of the doctype (e.g. "PUBLIC"). + # @return [String] + attr_accessor :type + + # The public ID of the doctype. + # @return [String] + attr_accessor :public_id + + # The system ID of the doctype. + # @return [String] + attr_accessor :system_id + + # The inline doctype rules. + # @return [String] + attr_accessor :inline_rules ## # @example diff --git a/lib/oga/xml/document.rb b/lib/oga/xml/document.rb index 79143e9..044af01 100644 --- a/lib/oga/xml/document.rb +++ b/lib/oga/xml/document.rb @@ -4,24 +4,18 @@ module Oga # Class used for storing information about an entire XML document. This # includes the doctype, XML declaration, child nodes and more. # - # @!attribute [rw] doctype - # The doctype of the document. - # @return [Oga::XML::Doctype] - # - # @!attribute [rw] xml_declaration - # The XML declaration of the document. - # @return [Oga::XML::XmlDeclaration] - # - # @!attribute [r] type - # The document type, either `:xml` or `:html`. - # @return [Symbol] - # class Document include Querying include Traversal - attr_accessor :doctype, :xml_declaration + # @return [Oga::XML::Doctype] + attr_accessor :doctype + # @return [Oga::XML::XmlDeclaration] + attr_accessor :xml_declaration + + # The document type, either `:xml` or `:html`. + # @return [Symbol] attr_reader :type ## diff --git a/lib/oga/xml/element.rb b/lib/oga/xml/element.rb index 106fa08..a847f9d 100644 --- a/lib/oga/xml/element.rb +++ b/lib/oga/xml/element.rb @@ -4,29 +4,19 @@ module Oga # Class that contains information about an XML element such as the name, # attributes and child nodes. # - # @!attribute [rw] name - # The name of the element. - # @return [String] - # - # @!attribute [r] namespace_name - # The name of the namespace. - # @return [String] - # - # @!attribute [rw] attributes - # The attributes of the element. - # @return [Array] - # - # @!attribute [rw] namespaces - # The registered namespaces. - # @return [Hash] - # class Element < Node include Querying + # @return [String] attr_reader :namespace_name - attr_accessor :name, :attributes + # @return [String] + attr_accessor :name + # @return [Array] + attr_accessor :attributes + + # @return [Hash] attr_writer :namespaces ## diff --git a/lib/oga/xml/namespace.rb b/lib/oga/xml/namespace.rb index 938330b..dc6317d 100644 --- a/lib/oga/xml/namespace.rb +++ b/lib/oga/xml/namespace.rb @@ -4,14 +4,12 @@ module Oga # The Namespace class contains information about XML namespaces such as the # name and URI. # - # @!attribute [r] name - # @return [String] - # - # @!attribute [r] uri - # @return [String] - # class Namespace - attr_accessor :name, :uri + # @return [String] + attr_accessor :name + + # @return [String] + attr_accessor :uri ## # @param [Hash] options diff --git a/lib/oga/xml/node.rb b/lib/oga/xml/node.rb index 8fc4cf4..defaa16 100644 --- a/lib/oga/xml/node.rb +++ b/lib/oga/xml/node.rb @@ -5,12 +5,10 @@ module Oga # {Oga::XML::NodeSet} and can be used to query surrounding and parent # nodes. # - # @!attribute [r] node_set - # @return [Oga::XML::NodeSet] - # class Node include Traversal + # @return [Oga::XML::NodeSet] attr_reader :node_set ## diff --git a/lib/oga/xml/node_set.rb b/lib/oga/xml/node_set.rb index 3d10247..6fd7662 100644 --- a/lib/oga/xml/node_set.rb +++ b/lib/oga/xml/node_set.rb @@ -31,12 +31,10 @@ module Oga # If ownership was not handled then you'd have to manually set the # `element` variable's `node_set` attribute after pushing it into a set. # - # @!attribute [rw] owner - # @return [Oga::XML::Node] - # class NodeSet include Enumerable + # @return [Oga::XML::Node] attr_accessor :owner ## diff --git a/lib/oga/xml/processing_instruction.rb b/lib/oga/xml/processing_instruction.rb index c0c2dbd..e334360 100644 --- a/lib/oga/xml/processing_instruction.rb +++ b/lib/oga/xml/processing_instruction.rb @@ -3,10 +3,8 @@ module Oga ## # Class used for storing information about a single processing instruction. # - # @!attribute [rw] name - # @return [String] - # class ProcessingInstruction < CharacterNode + # @return [String] attr_accessor :name ## diff --git a/lib/oga/xml/pull_parser.rb b/lib/oga/xml/pull_parser.rb index ae78fcb..3bf3709 100644 --- a/lib/oga/xml/pull_parser.rb +++ b/lib/oga/xml/pull_parser.rb @@ -19,16 +19,13 @@ module Oga # This parses yields proper XML instances such as {Oga::XML::Element}. # Doctypes and XML declarations are ignored by this parser. # - # @!attribute [r] node - # The current node. - # @return [Oga::XML::Node] - # - # @!attribute [r] nesting - # Array containing the names of the currently nested elements. - # @return [Array] - # class PullParser < Parser - attr_reader :node, :nesting + # @return [Oga::XML::Node] + attr_reader :node + + # Array containing the names of the currently nested elements. + # @return [Array] + attr_reader :nesting ## # @return [Array] diff --git a/lib/oga/xml/xml_declaration.rb b/lib/oga/xml/xml_declaration.rb index 4130548..f930cc3 100644 --- a/lib/oga/xml/xml_declaration.rb +++ b/lib/oga/xml/xml_declaration.rb @@ -3,20 +3,16 @@ module Oga ## # Class containing information about an XML declaration tag. # - # @!attribute [rw] version - # The XML version. - # @return [String] - # - # @!attribute [rw] encoding - # The XML document's encoding. - # @return [String] - # - # @!attribute [rw] standalone - # Whether or not the document is a standalone document. - # @return [String] - # class XmlDeclaration - attr_accessor :version, :encoding, :standalone + # @return [String] + attr_accessor :version + + # @return [String] + attr_accessor :encoding + + # Whether or not the document is a standalone document. + # @return [String] + attr_accessor :standalone ## # @param [Hash] options