Class: Solargraph::Pin::YardPin::Constant
- Inherits:
-
Constant
- Object
- Base
- BaseVariable
- Constant
- Solargraph::Pin::YardPin::Constant
- Includes:
- YardMixin
- Defined in:
- lib/solargraph/pin/yard_pin/constant.rb
Instance Attribute Summary
Attributes included from YardMixin
#code_object, #location, #spec
Attributes inherited from Constant
Attributes inherited from BaseVariable
Attributes inherited from Base
#code_object, #location, #name, #path, #return_type
Attributes included from Common
Instance Method Summary collapse
-
#initialize(code_object, closure = nil, spec = nil) ⇒ Constant
constructor
A new instance of Constant.
Methods inherited from Constant
#completion_item_kind, #path, #return_type, #symbol_kind
Methods inherited from BaseVariable
#==, #completion_item_kind, #nil_assignment?, #probe, #return_type, #symbol_kind, #try_merge!, #variable?
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
#binder, #comments, #context, #name, #namespace, #path, #return_type
Constructor Details
#initialize(code_object, closure = nil, spec = nil) ⇒ Constant
Returns a new instance of Constant.
9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/solargraph/pin/yard_pin/constant.rb', line 9 def initialize code_object, closure = nil, spec = nil closure ||= Solargraph::Pin::Namespace.new( name: code_object.namespace.to_s, gates: [code_object.namespace.to_s] ) super( location: object_location(code_object, spec), closure: closure, name: code_object.name.to_s, comments: code_object.docstring ? code_object.docstring.all.to_s : '', visibility: code_object.visibility ) end |