class Solargraph::Pin::Closure

Attributes

scope[R]

@return [::Symbol] :class or :instance

Public Class Methods

new(scope: :class, **splat) click to toggle source
Calls superclass method Solargraph::Pin::Base::new
# File lib/solargraph/pin/closure.rb, line 9
def initialize scope: :class, **splat
  super(**splat)
  @scope = scope
end

Public Instance Methods

binder() click to toggle source
# File lib/solargraph/pin/closure.rb, line 25
def binder
  @binder || context
end
context() click to toggle source
Calls superclass method Solargraph::Pin::Common#context
# File lib/solargraph/pin/closure.rb, line 14
def context
  @context ||= begin
    result = super
    if scope == :instance
      Solargraph::ComplexType.parse(result.namespace)
    else
      result
    end
  end
end
gates() click to toggle source

@return [Array<String>]

# File lib/solargraph/pin/closure.rb, line 30
def gates
  # @todo This check might not be necessary. There should always be a
  #   root pin
  closure ? closure.gates : ['']
end