Class: RubyLsp::Requests::Support::Annotation

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_lsp/requests/support/annotation.rb

Instance Method Summary collapse

Constructor Details

#initialize(arity:, receiver: false) ⇒ Annotation

: (arity: (Integer | Range), ?receiver: bool) -> void



9
10
11
12
# File 'lib/ruby_lsp/requests/support/annotation.rb', line 9

def initialize(arity:, receiver: false)
  @arity = arity
  @receiver = receiver
end

Instance Method Details

#match?(node) ⇒ Boolean

: (Prism::CallNode node) -> bool

Returns:

  • (Boolean)


15
16
17
# File 'lib/ruby_lsp/requests/support/annotation.rb', line 15

def match?(node)
  receiver_matches?(node) && arity_matches?(node)
end