Class: Solargraph::Pin::Block
- Defined in:
- lib/solargraph/pin/block.rb
Instance Attribute Summary collapse
-
#receiver ⇒ Parser::AST::Node
readonly
The signature of the method that receives this block.
Attributes inherited from Closure
Attributes inherited from Base
#code_object, #location, #name, #path, #return_type
Attributes included from Common
Instance Method Summary collapse
- #binder ⇒ Object
-
#initialize(receiver: nil, args: [], **splat) ⇒ Block
constructor
A new instance of Block.
- #parameter_names ⇒ Array<String>
- #parameters ⇒ Array<String>
- #rebind(api_map) ⇒ void
Methods inherited from Closure
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
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
#receiver ⇒ Parser::AST::Node (readonly)
The signature of the method that receives this block.
9 10 11 |
# File 'lib/solargraph/pin/block.rb', line 9 def receiver @receiver end |
Instance Method Details
#binder ⇒ Object
23 24 25 |
# File 'lib/solargraph/pin/block.rb', line 23 def binder @binder || closure.binder end |
#parameter_names ⇒ Array<String>
33 34 35 |
# File 'lib/solargraph/pin/block.rb', line 33 def parameter_names @parameter_names ||= parameters.map(&:name) end |
#parameters ⇒ 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.
19 20 21 |
# File 'lib/solargraph/pin/block.rb', line 19 def rebind api_map @binder ||= binder_or_nil(api_map) end |