Class: Solargraph::Pin::Block

Inherits:
Closure show all
Defined in:
lib/solargraph/pin/block.rb

Instance Attribute Summary collapse

Attributes inherited from Closure

#scope

Attributes inherited from Base

#code_object, #location, #name, #path, #return_type

Attributes included from Common

#closure, #location

Instance Method Summary collapse

Methods inherited from Closure

#context, #gates

Methods inherited from Base

#==, #comments, #completion_item_kind, #deprecated?, #directives, #docstring, #filename, #identity, #infer, #inspect, #macros, #maybe_directives?, #nearly?, #probe, #probed?, #proxied?, #proxy, #realize, #symbol_kind, #to_s, #try_merge!, #typify, #variable?

Methods included from Documenting

#documentation

Methods included from Conversions

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

Methods included from Common

#comments, #context, #name, #namespace, #path, #return_type

Constructor Details

#initialize(receiver: nil, args: [], **splat) ⇒ Block

Returns a new instance of Block.



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

def initialize receiver: nil, args: [], **splat
  super(**splat)
  @receiver = receiver
  @parameters = args
end

Instance Attribute Details

#receiverParser::AST::Node (readonly)

The signature of the method that receives this block.

Returns:

  • (Parser::AST::Node)


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

def receiver
  @receiver
end

Instance Method Details

#binderObject



23
24
25
# File 'lib/solargraph/pin/block.rb', line 23

def binder
  @binder || closure.binder
end

#parameter_namesArray<String>

Returns:

  • (Array<String>)


33
34
35
# File 'lib/solargraph/pin/block.rb', line 33

def parameter_names
  @parameter_names ||= parameters.map(&:name)
end

#parametersArray<String>

Returns:

  • (Array<String>)


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

def parameters
  @parameters ||= []
end

#rebind(api_map) ⇒ void

This method returns an undefined value.

Parameters:



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

def rebind api_map
  @binder ||= binder_or_nil(api_map)
end