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 =
All builtin Ruby classes and modules.
BUILTIN_CLASSES + BUILTIN_MODULES
-
BUILTIN_CLASSES =
Note:
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 =
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 =
::Hash
of BUILTIN_EXCEPTIONS as keys and true as value (for O(1) lookups)BUILTIN_EXCEPTIONS.inject({}) {|h, n| h.update(n => true) }
-
BUILTIN_MODULES =
All builtin Ruby modules for mixin handling.
["Comparable", "Enumerable", "Errno", "FileTest", "GC", "Kernel", "Marshal", "Math", "ObjectSpace", "Precision", "Process", "Signal"]
-
CONSTANTMATCH =
Regular expression to match constant name
/[A-Z]\w*/
-
CONSTANTSTART =
Regular expression to match the beginning of a constant
/^[A-Z]/
-
CSEP =
Class method separator
'.'
-
CSEPQ =
Regex-quoted class method separator
Regexp.quote CSEP
-
ISEP =
Instance method separator
'#'
-
ISEPQ =
Regex-quoted instance method separator
ISEP
-
METHODMATCH =
Regular expression to match a fully qualified method def (self.foo, Class.foo).
/(?:(?:#{NAMESPACEMATCH}|[a-z]\w*)\s*(?:#{CSEPQ}|#{NSEPQ})\s*)?#{METHODNAMEMATCH}/
-
METHODNAMEMATCH =
Regular expression to match a method name
%r{[a-zA-Z_]\w*[!?=]?|[-+~]\@|<<|>>|=~|===?|![=~]?|<=>|[<>]=?|\*\*|[-/+%^&*~`|]|\[\]=?}
-
NAMESPACEMATCH =
Regular expression to match namespaces (const A or complex path A::B)
/(?:(?:#{NSEPQ}\s*)?#{CONSTANTMATCH})+/
-
NSEP =
Namespace separator
'::'
-
NSEPQ =
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. |