Class: Solargraph::Pin::Block

Inherits:
Base
  • Object
show all
Defined in:
lib/solargraph/pin/block.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#location, #name, #namespace, #path

Instance Method Summary collapse

Methods inherited from Base

#==, #comments, #completion_item_kind, #context, #deprecated?, #directives, #docstring, #filename, #infer, #macros, #maybe_directives?, #return_complex_type, #return_type, #symbol_kind, #to_s, #try_merge!, #variable?

Methods included from Documenting

#documentation

Methods included from Conversions

#completion_item, #detail, #link_documentation, #reset_conversions, #resolve_completion_item, #signature_help

Constructor Details

#initialize(location, namespace, name, comments, receiver, context) ⇒ Block

Returns a new instance of Block.



12
13
14
15
16
# File 'lib/solargraph/pin/block.rb', line 12

def initialize location, namespace, name, comments, receiver, context
  super(location, namespace, name, comments)
  @receiver = receiver
  @context = context
end

Instance Attribute Details

#parametersArray<String> (readonly)

Returns:

  • (Array<String>)


10
11
12
# File 'lib/solargraph/pin/block.rb', line 10

def parameters
  @parameters
end

#receiverParser::AST::Node (readonly)

The signature of the method that receives this block.

Returns:

  • (Parser::AST::Node)


7
8
9
# File 'lib/solargraph/pin/block.rb', line 7

def receiver
  @receiver
end

Instance Method Details

#kindObject



18
19
20
# File 'lib/solargraph/pin/block.rb', line 18

def kind
  Pin::BLOCK
end

#nearly?(other) ⇒ Boolean

Returns:

  • (Boolean)


26
27
28
29
30
31
# File 'lib/solargraph/pin/block.rb', line 26

def nearly? other
  return false unless super
  # @todo Trying to not to block merges too much
  # receiver == other.receiver and parameters == other.parameters
  true
end