Module: YARD::CodeObjects
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 Base.
Constant Summary
-
BUILTIN_ALL =
# File 'lib/yard/code_objects/base.rb', line 91
All builtin Ruby classes and modules.
BUILTIN_CLASSES + BUILTIN_MODULES
-
BUILTIN_CLASSES =
# File 'lib/yard/code_objects/base.rb', line 78Note:
MatchingData is a 1.8.x legacy class
All builtin Ruby classes for inheritance tree.
["Array", "Bignum", "Binding", "Class", "Complex", "ConditionVariable", "Data", "Dir", "Encoding", "Enumerator", "FalseClass", "Fiber", "File", "Fixnum", "Float", "Hash", "IO", "Integer", "MatchData", "Method", "Module", "NilClass", "Numeric", "Object", "Proc", "Queue", "Random", "Range", "Rational", "Regexp", "RubyVM", "SizedQueue", "String", "Struct", "Symbol", "Thread", "ThreadGroup", "Time", "TracePoint", "TrueClass", "UnboundMethod"] + BUILTIN_EXCEPTIONS
-
BUILTIN_EXCEPTIONS =
# File 'lib/yard/code_objects/base.rb', line 67
All builtin Ruby exception classes for inheritance tree.
["ArgumentError", "ClosedQueueError", "EncodingError", "EOFError", "Exception", "FiberError", "FloatDomainError", "IndexError", "Interrupt", "IOError", "KeyError", "LoadError", "LocalJumpError", "NameError", "NoMemoryError", "NoMethodError", "NotImplementedError", "RangeError", "RegexpError", "RuntimeError", "ScriptError", "SecurityError", "SignalException", "StandardError", "StopIteration", "SyntaxError", "SystemCallError", "SystemExit", "SystemStackError", "ThreadError", "TypeError", "UncaughtThrowError", "ZeroDivisionError"]
-
BUILTIN_EXCEPTIONS_HASH =
# File 'lib/yard/code_objects/base.rb', line 94
::Hashof BUILTIN_EXCEPTIONS as keys and true as value (for O(1) lookups)BUILTIN_EXCEPTIONS.inject({}) {|h, n| h.update(n => true) }
-
BUILTIN_MODULES =
# File 'lib/yard/code_objects/base.rb', line 87
All builtin Ruby modules for mixin handling.
["Comparable", "Enumerable", "Errno", "FileTest", "GC", "Kernel", "Marshal", "Math", "ObjectSpace", "Precision", "Process", "Signal"]
-
CONSTANTMATCH =
# File 'lib/yard/code_objects/base.rb', line 52
Regular expression to match constant name
/[A-Z]\w*/ -
CONSTANTSTART =
# File 'lib/yard/code_objects/base.rb', line 55
Regular expression to match the beginning of a constant
/^[A-Z]/ -
CSEP =
# File 'lib/yard/code_objects/base.rb', line 46
Class method separator
'.' -
CSEPQ =
# File 'lib/yard/code_objects/base.rb', line 49
Regex-quoted class method separator
Regexp.quote CSEP
-
ISEP =
# File 'lib/yard/code_objects/base.rb', line 40
Instance method separator
'#' -
ISEPQ =
# File 'lib/yard/code_objects/base.rb', line 43
Regex-quoted instance method separator
ISEP -
METHODMATCH =
# File 'lib/yard/code_objects/base.rb', line 64
Regular expression to match a fully qualified method def (self.foo, Class.foo).
/(?:(?:#{NAMESPACEMATCH}|[a-z]\w*)\s*(?:#{CSEPQ}|#{NSEPQ})\s*)?#{METHODNAMEMATCH}/ -
METHODNAMEMATCH =
# File 'lib/yard/code_objects/base.rb', line 61
Regular expression to match a method name
%r{[a-zA-Z_]\w*[!?=]?|[-+~]\@|<<|>>|=~|===?|![=~]?|<=>|[<>]=?|\*\*|[-/+%^&*~`|]|\[\]=?} -
NAMESPACEMATCH =
# File 'lib/yard/code_objects/base.rb', line 58
Regular expression to match namespaces (const A or complex path A::B)
/(?:(?:#{NSEPQ}\s*)?#{CONSTANTMATCH})+/ -
NSEP =
# File 'lib/yard/code_objects/base.rb', line 34
Namespace separator
'::' -
NSEPQ =
# File 'lib/yard/code_objects/base.rb', line 37
Regex-quoted namespace separator
NSEP -
PROXY_MATCH =
Internal use only
# File 'lib/yard/code_objects/proxy.rb', line 8/(?:#{NSEPQ}|#{ISEPQ}|#{CSEPQ})([^#{Regexp.quote( (NSEP + ISEP + CSEP).split('').uniq.join )}]+)$/
Class Method Summary
NamespaceMapper - Extended
| clear_separators | Clears the map of separators. |
| default_separator | Gets or sets the default separator value to use when no separator for the namespace can be determined. |
| register_separator | Registers a separator with an optional set of valid types that must follow the separator lexically. |
| separators, separators_for_type, separators_match, types_for_separator, | |
| unregister_separator_by_type | Unregisters a separator by a type. |