Module: YARD::Handlers::Ruby::DSLHandlerMethods
Constant Summary
collapse
- IGNORE_METHODS =
Hash[*%w(alias alias_method autoload attr attr_accessor
attr_reader attr_writer extend include public private protected
private_constant).map {|n| [n, true]
Constants included
from CodeObjects
CodeObjects::BUILTIN_ALL, CodeObjects::BUILTIN_CLASSES, CodeObjects::BUILTIN_EXCEPTIONS, CodeObjects::BUILTIN_EXCEPTIONS_HASH, CodeObjects::BUILTIN_MODULES, CodeObjects::CONSTANTMATCH, CodeObjects::CSEP, CodeObjects::CSEPQ, CodeObjects::ISEP, CodeObjects::ISEPQ, CodeObjects::METHODMATCH, CodeObjects::METHODNAMEMATCH, CodeObjects::NAMESPACEMATCH, CodeObjects::NSEP, CodeObjects::NSEPQ
Instance Method Summary
collapse
Instance Method Details
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
# File 'lib/yard/handlers/ruby/dsl_handler_methods.rb', line 12
def handle_comments
return if IGNORE_METHODS[caller_method]
@docstring = statement. || ""
@docstring = @docstring.join("\n") if @docstring.is_a?(Array)
if macro = find_attached_macro
@docstring += "\n" +
macro.expand([caller_method, *call_params], statement.source)
elsif !statement. && !implicit_docstring?
return register_docstring(nil)
end
if @docstring =~ /^@!?(method|attribute)\b/
return register_docstring(nil)
end
object = MethodObject.new(namespace, method_name, scope)
object.signature = method_signature
register(object)
end
|
#register_docstring(object, docstring = @docstring, stmt = statement) ⇒ Object
34
35
36
|
# File 'lib/yard/handlers/ruby/dsl_handler_methods.rb', line 34
def register_docstring(object, docstring = @docstring, stmt = statement)
super
end
|