lib/yard/handlers/ruby/base.rb in yard-0.9.5 vs lib/yard/handlers/ruby/base.rb in yard-0.9.6
- old
+ new
@@ -1,5 +1,6 @@
+# frozen_string_literal: true
module YARD
module Handlers
module Ruby
# To implement a custom handler matcher, subclass this class and implement
# {#matches?} to return whether a node matches the handler.
@@ -21,11 +22,13 @@
def initialize(name) @name = name end
# Tests if the node matches the handler
# @param [Parser::Ruby::AstNode] node a Ruby node
# @return [Boolean] whether the +node+ matches the handler
- def matches?(node) raise NotImplementedError end
+ def matches?(node) # rubocop:disable Lint/UnusedMethodArgument
+ raise NotImplementedError
+ end
protected
# @return [String] the extension matcher value
attr_reader :name
@@ -152,13 +155,11 @@
def caller_method
if statement.call? || statement.def?
statement.method_name(true).to_s
elsif statement.type == :var_ref || statement.type == :vcall
statement[0].jump(:ident, :kw).source
- else
- nil
end
end
end
end
end
-end
\ No newline at end of file
+end