Object | +--YARD::CodeObject
The documentation parser is responsible for parsing the docstring into text and saving the meta tags attached to it
attributes [R]
children [R, W]
docstring [R]
file [R]
full_source [R]
line [R]
name [R]
parent [R, W]
scope [R, W]
source [R]
type [R]
visibility [R, W]
Creates a new code object with necessary information such as the object’s name (not full path), it’s type (:class, :module, :method, etc.), visibility (:public, :private, :protected) and scope (:instance or :class level). Optionally you can specify a parent object and comments too, but these can also be assigned later through the #parent= and #attach_docstring methods.
This class handles dynamic methods through the method_missing method
method_missing(meth, *args, &block)See if the method call exists in the attributes hash, and return it. Otherwise send the missing method call up the stack.
| Object |
[](key)
|
| Object |
[]=(key, value)
|
| Object |
attach_docstring(comments)
Attaches a docstring to a code oject by parsing the comments attached to the statement . |
| Object |
attach_full_source(source)
Manually attaches full source code for an object given the source . |
| Object |
attach_source(statement, file = nil)
Attaches source code to a code object with an optional file location . |
| Object |
attributes
Returns the value of attribute attributes . |
| Object |
attributes=(value)
Sets the attribute attributes . |
| Object |
children
Returns the value of attribute children . |
| Object |
children=(value)
Sets the attribute children . |
| Object |
docstring
Returns the value of attribute docstring . |
| Object |
docstring=(value)
Sets the attribute docstring . |
| Object |
file
Returns the value of attribute file . |
| Object |
file=(value)
Sets the attribute file . |
| String |
format(type = :html)
Returns a code object formatted as a given type, defaults to html. . |
| Object |
full_source
Returns the value of attribute full_source . |
| Object |
full_source=(value)
Sets the attribute full_source . |
| Boolean |
has_tag?(name)
Returns true if at least one tag by the name name was declared . |
| Object |
line
Returns the value of attribute line . |
| Object |
line=(value)
Sets the attribute line . |
| Object |
name
Returns the value of attribute name . |
| Object |
name=(value)
Sets the attribute name . |
| Object |
parent
Returns the value of attribute parent . |
| Object |
parent=(value)
Sets the parent object and registers the object path with . |
| Object |
path
Returns the unique path for this code object . |
| Object |
scope
Returns the value of attribute scope . |
| Object |
scope=(value)
Sets the attribute scope . |
| Object |
source
Returns the value of attribute source . |
| Object |
source=(value)
Sets the attribute source . |
| BaseTag |
tag(name)
Convenience method to return the first tag . |
|
Array |
tags(name = nil)
Returns a list of tags specified by name or all tags if name is not specified. . |
| Object |
to_s
|
| Object |
type
Returns the value of attribute type . |
| Object |
type=(value)
Sets the attribute type . |
| Object |
visibility
Returns the value of attribute visibility . |
| Object |
visibility=(value)
Sets the attribute visibility . |
Attaches a docstring to a code oject by parsing the comments attached to the statement and filling the #tags and #docstring methods with the parsed information.
Manually attaches full source code for an object given the source as a String
Returns the value of attribute attributes
Sets the attribute attributes
Returns the value of attribute children
Sets the attribute children
Returns the value of attribute docstring
Sets the attribute docstring
Returns the value of attribute file
Sets the attribute file
Returns a code object formatted as a given type, defaults to html.
Returns the value of attribute full_source
Sets the attribute full_source
Returns true if at least one tag by the name name was declared
Returns the value of attribute line
Sets the attribute line
Returns the value of attribute name
Sets the attribute name
Returns the value of attribute parent
Sets the parent object and registers the object path with the Namespace. If the object was already registered to an old path, it will be removed from the namespace.
Returns the unique path for this code object. The resulting path will be a Ruby style path name of the namespace the object resides in plus the object name delimited by a "::" or "#" depending on if the object is an instance level object or a class level object.
Example:
Returns the value of attribute scope
Sets the attribute scope
Returns the value of attribute source
Sets the attribute source
Convenience method to return the first tag object in the list of tag objects of that name
Example:
doc = YARD::Documentation.new("@return zero when nil")
doc.tag("return").text # => "zero when nil"
Returns the value of attribute type
Sets the attribute type
Returns the value of attribute visibility
Sets the attribute visibility