Module: Solargraph::Pin::Common
- Included in:
- Base, Conversions
- Defined in:
- lib/solargraph/pin/common.rb
Instance Attribute Summary collapse
- #context ⇒ ComplexType (also: #full_context) readonly
- #location ⇒ Location readonly
Instance Method Summary collapse
- #binder ⇒ ComplexType
-
#closure ⇒ Pin::Closure?
@sg-ignore Solargraph::Pin::Common#closure return type could not be inferred.
- #comments ⇒ String
- #name ⇒ String
- #namespace ⇒ String
- #path ⇒ String
- #return_type ⇒ ComplexType
- #source ⇒ Source? abstract
Instance Attribute Details
#context ⇒ ComplexType Also known as: full_context
32 33 34 35 |
# File 'lib/solargraph/pin/common.rb', line 32 def context # Get the static context from the nearest namespace @context ||= find_context end |
#location ⇒ Location (readonly)
12 13 14 |
# File 'lib/solargraph/pin/common.rb', line 12 def location @location end |
Instance Method Details
#binder ⇒ ComplexType
44 45 46 |
# File 'lib/solargraph/pin/common.rb', line 44 def binder @binder || context end |
#closure ⇒ Pin::Closure?
@sg-ignore Solargraph::Pin::Common#closure return type could not be inferred
16 17 18 19 |
# File 'lib/solargraph/pin/common.rb', line 16 def closure Solargraph.assert_or_log(:closure, "Closure not set on #{self.class} #{name.inspect} from #{source.inspect}") unless @closure @closure end |
#comments ⇒ String
49 50 51 |
# File 'lib/solargraph/pin/common.rb', line 49 def comments @comments ||= '' end |
#name ⇒ String
22 23 24 |
# File 'lib/solargraph/pin/common.rb', line 22 def name @name ||= '' end |
#namespace ⇒ String
39 40 41 |
# File 'lib/solargraph/pin/common.rb', line 39 def namespace context.namespace.to_s end |
#path ⇒ String
54 55 56 |
# File 'lib/solargraph/pin/common.rb', line 54 def path @path ||= name.empty? ? context.namespace : "#{context.namespace}::#{name}" end |
#return_type ⇒ ComplexType
27 28 29 |
# File 'lib/solargraph/pin/common.rb', line 27 def return_type @return_type ||= ComplexType::UNDEFINED end |