Class: RubyLanguageServer::ScopeData::Base

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
lib/ruby_language_server/scope_data/base.rb

Direct Known Subclasses

Scope, Variable

Constant Summary collapse

TYPE_MODULE =
'module'
TYPE_CLASS =
'class'
TYPE_METHOD =
'method'
TYPE_BLOCK =
'block'
TYPE_ROOT =
'root'
TYPE_VARIABLE =
'variable'
BLOCK_NAME =
'block'
JoinHash =
{
  TYPE_MODULE => '::',
  TYPE_CLASS => '::',
  TYPE_METHOD => '#',
  TYPE_BLOCK => '>',
  TYPE_ROOT => '',
  TYPE_VARIABLE => '^'
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#typeObject

Type of this scope (module, class, block)



28
29
30
# File 'lib/ruby_language_server/scope_data/base.rb', line 28

def type
  @type
end

Instance Method Details

#method?Boolean

RubyLanguageServer::ScopeData::Scope.connection.exec_query(“SELECT LEVENSHTEIN( ‘This is not correct’, ‘This is correct’ )”)

Returns:

  • (Boolean)


39
40
41
# File 'lib/ruby_language_server/scope_data/base.rb', line 39

def method?
  type == TYPE_METHOD
end