Module: YARD::CodeObjects

Defined in:
lib/yard/autoload.rb,
lib/yard/code_objects/base.rb,
lib/yard/code_objects/proxy.rb,
lib/yard/code_objects/root_object.rb,
lib/yard/code_objects/class_object.rb,
lib/yard/code_objects/method_object.rb,
lib/yard/code_objects/module_object.rb,
lib/yard/code_objects/constant_object.rb,
lib/yard/code_objects/namespace_object.rb,
lib/yard/code_objects/class_variable_object.rb,
lib/yard/code_objects/extended_method_object.rb

Overview

A “code object” is defined as any entity in the Ruby language. Classes, modules, methods, class variables and constants are the major objects, but DSL languages can create their own by inheriting from CodeObjects::Base.

Defined Under Namespace

Classes: Base, ClassObject, ClassVariableObject, CodeObjectList, ConstantObject, ExtendedMethodObject, MethodObject, ModuleObject, NamespaceObject, Proxy, ProxyMethodError, RootObject

Constant Summary

NSEP =
'::'
NSEPQ =
NSEP
ISEP =
'#'
ISEPQ =
ISEP
CSEP =
'.'
CSEPQ =
Regexp.quote CSEP
CONSTANTMATCH =
/[A-Z]\w*/
NAMESPACEMATCH =
/(?:(?:#{NSEPQ})?#{CONSTANTMATCH})+/
METHODNAMEMATCH =
/[a-zA-Z_]\w*[!?=]?|[-+~]\@|<<|>>|=~|===?|<=>|[<>]=?|\*\*|[-\/+%^&*~`|]|\[\]=?/
METHODMATCH =
/(?:(?:#{NAMESPACEMATCH}|self)\s*(?:#{CSEPQ}|#{NSEPQ})\s*)?#{METHODNAMEMATCH}/
BUILTIN_EXCEPTIONS =
["SecurityError", "Exception", "NoMethodError", "FloatDomainError", 
"IOError", "TypeError", "NotImplementedError", "SystemExit", "Interrupt", "SyntaxError", 
"RangeError", "NoMemoryError", "ArgumentError", "ThreadError", "EOFError", "RuntimeError", 
"ZeroDivisionError", "StandardError", "LoadError", "NameError", "LocalJumpError", "SystemCallError", 
"SignalException", "ScriptError", "SystemStackError", "RegexpError", "IndexError"]
BUILTIN_CLASSES = Note: MatchingData is a 1.8.x legacy class.
["TrueClass", "Array", "Dir", "Struct", "UnboundMethod", "Object", "Fixnum", "Float", 
"ThreadGroup", "MatchingData", "MatchData", "Proc", "Binding", "Class", "Time", "Bignum", "NilClass", "Symbol", 
"Numeric", "String", "Data", "MatchData", "Regexp", "Integer", "File", "IO", "Range", "FalseClass", 
"Method", "Continuation", "Thread", "Hash", "Module"] + BUILTIN_EXCEPTIONS
BUILTIN_MODULES =
["ObjectSpace", "Signal", "Marshal", "Kernel", "Process", "GC", "FileTest", "Enumerable", 
"Comparable", "Errno", "Precision", "Math"]
BUILTIN_ALL =
BUILTIN_CLASSES + BUILTIN_MODULES
BUILTIN_EXCEPTIONS_HASH =
BUILTIN_EXCEPTIONS.inject({}) {|h,n| h.update(n => true) }