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, #source
Attributes included from Common
Instance Method Summary collapse
- #binder ⇒ Object
-
#initialize(receiver: nil, args: [], context: nil, **splat) ⇒ Block
constructor
A new instance of Block.
- #parameter_names ⇒ Array<String>
- #parameters ⇒ Array<Parameter>
- #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: [], context: nil, **splat) ⇒ Block
Returns a new instance of Block.
12 13 14 15 16 17 |
# File 'lib/solargraph/pin/block.rb', line 12 def initialize receiver: nil, args: [], context: nil, **splat super(**splat) @receiver = receiver @context = context @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
25 26 27 |
# File 'lib/solargraph/pin/block.rb', line 25 def binder @binder || closure.binder end |
#parameter_names ⇒ Array<String>
35 36 37 |
# File 'lib/solargraph/pin/block.rb', line 35 def parameter_names @parameter_names ||= parameters.map(&:name) end |
#parameters ⇒ Array<Parameter>
30 31 32 |
# File 'lib/solargraph/pin/block.rb', line 30 def parameters @parameters ||= [] end |
#rebind(api_map) ⇒ void
This method returns an undefined value.
21 22 23 |
# File 'lib/solargraph/pin/block.rb', line 21 def rebind api_map @binder ||= binder_or_nil(api_map) end |