Class: Solargraph::Pin::Block
- Defined in:
- lib/solargraph/pin/block.rb
Instance Attribute Summary collapse
- #node ⇒ Parser::AST::Node readonly
- #receiver ⇒ Parser::AST::Node readonly
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, node: nil, **splat) ⇒ Block
constructor
A new instance of Block.
- #parameter_names ⇒ ::Array<String>
- #parameters ⇒ ::Array<Parameter>
- #rebind(api_map) ⇒ void
Methods inherited from Closure
#context, #gates, #generics, #generics_as_rbs
Methods inherited from Base
#==, #comments, #completion_item_kind, #deprecated?, #desc, #directives, #docstring, #erase_generics, #filename, #identity, #infer, #inspect, #macros, #maybe_directives?, #nearly?, #probe, #probed?, #proxied?, #proxy, #realize, #resolve_generics, #resolve_generics_from_context, #symbol_kind, #to_rbs, #to_s, #transform_types, #try_merge!, #typify, #variable?
Methods included from Documenting
#documentation, normalize_indentation, strip_html_comments
Methods included from Conversions
#completion_item, #completion_item_kind, #deprecated?, #detail, #link_documentation, #probed?, #proxied?, #reset_conversions, #resolve_completion_item, #signature_help, #text_documentation
Methods included from Common
#comments, #name, #namespace, #path, #return_type
Constructor Details
#initialize(receiver: nil, args: [], context: nil, node: nil, **splat) ⇒ Block
Returns a new instance of Block.
16 17 18 19 20 21 22 |
# File 'lib/solargraph/pin/block.rb', line 16 def initialize receiver: nil, args: [], context: nil, node: nil, **splat super(**splat) @receiver = receiver @context = context @parameters = args @node = node end |
Instance Attribute Details
#node ⇒ Parser::AST::Node (readonly)
10 11 12 |
# File 'lib/solargraph/pin/block.rb', line 10 def node @node end |
#receiver ⇒ Parser::AST::Node (readonly)
7 8 9 |
# File 'lib/solargraph/pin/block.rb', line 7 def receiver @receiver end |
Instance Method Details
#binder ⇒ Object
30 31 32 |
# File 'lib/solargraph/pin/block.rb', line 30 def binder @binder || closure.binder end |
#parameter_names ⇒ ::Array<String>
40 41 42 |
# File 'lib/solargraph/pin/block.rb', line 40 def parameter_names @parameter_names ||= parameters.map(&:name) end |
#parameters ⇒ ::Array<Parameter>
35 36 37 |
# File 'lib/solargraph/pin/block.rb', line 35 def parameters @parameters ||= [] end |
#rebind(api_map) ⇒ void
This method returns an undefined value.
26 27 28 |
# File 'lib/solargraph/pin/block.rb', line 26 def rebind api_map @binder ||= binder_or_nil(api_map) end |