Class: YARD::Handlers::Ruby::ExceptionHandler
Overview
Handles 'raise' calls inside methods
Constant Summary
Instance Attribute Summary
Attributes inherited from Base
#namespace, #owner, #parser, #scope, #statement, #visibility
Instance Method Summary (collapse)
-
- (Object) process
Main processing callback.
Methods inherited from Base
handles?, meta_type, method_call, #parse_block
Methods included from Parser::Ruby
Methods inherited from Base
clear_subclasses, #ensure_loaded!, handlers, handles, handles?, #initialize, namespace_only, namespace_only?, #parse_block, process, #push_state, #register, subclasses
Constructor Details
This class inherits a constructor from YARD::Handlers::Base
Instance Method Details
- (Object) process
Main processing callback
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/yard/handlers/ruby/exception_handler.rb', line 5 process do return unless owner.is_a?(MethodObject) # Only methods yield return if [:command_call, :call].include? statement.type return if owner.has_tag?(:raise) klass = nil params = statement.parameters(false) if params.size == 1 if params.first.ref? && params.first.first.type != :ident klass = params.first.source elsif params.first.call? && params.first.method_name(true) == :new klass = params.first.namespace.source end else klass = params.first.source end owner.docstring.add_tag YARD::Tags::Tag.new(:raise, '', klass) if klass end |