Class: Solargraph::Pin::Constant

Inherits:
BaseVariable show all
Defined in:
lib/solargraph/pin/constant.rb

Instance Attribute Summary

Attributes inherited from Base

#namespace, #node, #source

Instance Method Summary collapse

Methods inherited from BaseVariable

#return_type, #signature

Methods included from NodeMethods

#const_from, #infer_literal_node_type, #pack_name, #resolve_node_signature, #unpack_name

Methods inherited from Base

#docstring, #filename, #initialize, #location, #parameters, #path, #return_type, #signature

Constructor Details

This class inherits a constructor from Solargraph::Pin::Base

Instance Method Details

#kindObject



9
10
11
# File 'lib/solargraph/pin/constant.rb', line 9

def kind
  Solargraph::Suggestion::CONSTANT
end

#nameObject



5
6
7
# File 'lib/solargraph/pin/constant.rb', line 5

def name
  @name ||= node.children[1].to_s
end

#valueObject



13
14
15
# File 'lib/solargraph/pin/constant.rb', line 13

def value
  source.code_for(node.children[2])
end