class YARD::Handlers::RBS::Base
Base class for all RBS handlers. Handlers match on the {Parser::RBS::Statement#type} symbol of the current statement and process it to create or annotate code objects.
Public Class Methods
Source
# File lib/yard/handlers/rbs/base.rb, line 11 def self.handles?(statement, _processor) handlers.any? do |matcher| case matcher when Symbol statement.type == matcher when String statement.type.to_s == matcher when Regexp (statement.source || '') =~ matcher else false end end end
@return [Boolean] whether this handler matches the given statement
Public Instance Methods
Source
# File lib/yard/handlers/rbs/base.rb, line 29 def parse_block(opts = {}) return if statement.block.nil? || statement.block.empty? push_state(opts) do parser.process(statement.block) end end
Recurse into the body of a namespace statement. @param opts [Hash] state overrides @see push_state