Removed usage of YARD @!attribute macros

This commit is contained in:
Yorick Peterse 2015-06-16 00:04:10 +02:00
parent 2c18a51ba9
commit bcffd86c50
11 changed files with 67 additions and 104 deletions

View File

@ -3,19 +3,17 @@ module Oga
## ##
# Class for storing information about a single XML attribute. # Class for storing information about a single XML attribute.
# #
# @!attribute [rw] name class Attribute
# The name of the attribute. # The name of the attribute.
# @return [String] # @return [String]
# attr_accessor :name
# @!attribute [rw] namespace_name
# @return [String] # @return [String]
# attr_accessor :namespace_name
# @!attribute [r] element
# The element this attribute belongs to. # The element this attribute belongs to.
# @return [Oga::XML::Element] # @return [Oga::XML::Element]
# attr_accessor :element
class Attribute
attr_accessor :name, :namespace_name, :element
## ##
# The default namespace available to all attributes. This namespace can # The default namespace available to all attributes. This namespace can

View File

@ -4,10 +4,8 @@ module Oga
# Base class for nodes that represent a text-like value such as Text and # Base class for nodes that represent a text-like value such as Text and
# Comment nodes. # Comment nodes.
# #
# @!attribute [rw] text
# @return [String]
#
class CharacterNode < Node class CharacterNode < Node
# @return [String]
attr_accessor :text attr_accessor :text
## ##

View File

@ -3,28 +3,26 @@ module Oga
## ##
# Class used for storing information about Doctypes. # Class used for storing information about Doctypes.
# #
# @!attribute [rw] name class Doctype
# The name of the doctype (e.g. "HTML"). # The name of the doctype (e.g. "HTML").
# @return [String] # @return [String]
# attr_accessor :name
# @!attribute [rw] type
# The type of the doctype (e.g. "PUBLIC"). # The type of the doctype (e.g. "PUBLIC").
# @return [String] # @return [String]
# attr_accessor :type
# @!attribute [rw] public_id
# The public ID of the doctype. # The public ID of the doctype.
# @return [String] # @return [String]
# attr_accessor :public_id
# @!attribute [rw] system_id
# The system ID of the doctype. # The system ID of the doctype.
# @return [String] # @return [String]
# attr_accessor :system_id
# @!attribute [rw] inline_rules
# The inline doctype rules. # The inline doctype rules.
# @return [String] # @return [String]
# attr_accessor :inline_rules
class Doctype
attr_accessor :name, :type, :public_id, :system_id, :inline_rules
## ##
# @example # @example

View File

@ -4,24 +4,18 @@ module Oga
# Class used for storing information about an entire XML document. This # Class used for storing information about an entire XML document. This
# includes the doctype, XML declaration, child nodes and more. # 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 class Document
include Querying include Querying
include Traversal 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 attr_reader :type
## ##

View File

@ -4,29 +4,19 @@ module Oga
# Class that contains information about an XML element such as the name, # Class that contains information about an XML element such as the name,
# attributes and child nodes. # 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<Oga::XML::Attribute>]
#
# @!attribute [rw] namespaces
# The registered namespaces.
# @return [Hash]
#
class Element < Node class Element < Node
include Querying include Querying
# @return [String]
attr_reader :namespace_name attr_reader :namespace_name
attr_accessor :name, :attributes # @return [String]
attr_accessor :name
# @return [Array<Oga::XML::Attribute>]
attr_accessor :attributes
# @return [Hash]
attr_writer :namespaces attr_writer :namespaces
## ##

View File

@ -4,14 +4,12 @@ module Oga
# The Namespace class contains information about XML namespaces such as the # The Namespace class contains information about XML namespaces such as the
# name and URI. # name and URI.
# #
# @!attribute [r] name
# @return [String]
#
# @!attribute [r] uri
# @return [String]
#
class Namespace class Namespace
attr_accessor :name, :uri # @return [String]
attr_accessor :name
# @return [String]
attr_accessor :uri
## ##
# @param [Hash] options # @param [Hash] options

View File

@ -5,12 +5,10 @@ module Oga
# {Oga::XML::NodeSet} and can be used to query surrounding and parent # {Oga::XML::NodeSet} and can be used to query surrounding and parent
# nodes. # nodes.
# #
# @!attribute [r] node_set
# @return [Oga::XML::NodeSet]
#
class Node class Node
include Traversal include Traversal
# @return [Oga::XML::NodeSet]
attr_reader :node_set attr_reader :node_set
## ##

View File

@ -31,12 +31,10 @@ module Oga
# If ownership was not handled then you'd have to manually set the # 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. # `element` variable's `node_set` attribute after pushing it into a set.
# #
# @!attribute [rw] owner
# @return [Oga::XML::Node]
#
class NodeSet class NodeSet
include Enumerable include Enumerable
# @return [Oga::XML::Node]
attr_accessor :owner attr_accessor :owner
## ##

View File

@ -3,10 +3,8 @@ module Oga
## ##
# Class used for storing information about a single processing instruction. # Class used for storing information about a single processing instruction.
# #
# @!attribute [rw] name
# @return [String]
#
class ProcessingInstruction < CharacterNode class ProcessingInstruction < CharacterNode
# @return [String]
attr_accessor :name attr_accessor :name
## ##

View File

@ -19,16 +19,13 @@ module Oga
# This parses yields proper XML instances such as {Oga::XML::Element}. # This parses yields proper XML instances such as {Oga::XML::Element}.
# Doctypes and XML declarations are ignored by this parser. # Doctypes and XML declarations are ignored by this parser.
# #
# @!attribute [r] node class PullParser < Parser
# The current node.
# @return [Oga::XML::Node] # @return [Oga::XML::Node]
# attr_reader :node
# @!attribute [r] nesting
# Array containing the names of the currently nested elements. # Array containing the names of the currently nested elements.
# @return [Array] # @return [Array]
# attr_reader :nesting
class PullParser < Parser
attr_reader :node, :nesting
## ##
# @return [Array] # @return [Array]

View File

@ -3,20 +3,16 @@ module Oga
## ##
# Class containing information about an XML declaration tag. # Class containing information about an XML declaration tag.
# #
# @!attribute [rw] version class XmlDeclaration
# The XML version.
# @return [String] # @return [String]
# attr_accessor :version
# @!attribute [rw] encoding
# The XML document's encoding.
# @return [String] # @return [String]
# attr_accessor :encoding
# @!attribute [rw] standalone
# Whether or not the document is a standalone document. # Whether or not the document is a standalone document.
# @return [String] # @return [String]
# attr_accessor :standalone
class XmlDeclaration
attr_accessor :version, :encoding, :standalone
## ##
# @param [Hash] options # @param [Hash] options