Class: Yoda::Services::CommentCompletion::BaseProvider Abstract

Inherits:
Object
  • Object
show all
Defined in:
lib/yoda/services/comment_completion/base_provider.rb

Overview

This class is abstract.

Direct Known Subclasses

ParamProvider, TagProvider, TypeProvider

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(environment, ast, comments, location) ⇒ BaseProvider

Returns a new instance of BaseProvider.

Parameters:

  • environment (Model::Environment)
  • ast (::Parser::AST::Node)
  • comments (Array<::Parser::Source::Comment>)
  • location (Location)


22
23
24
25
26
27
# File 'lib/yoda/services/comment_completion/base_provider.rb', line 22

def initialize(environment, ast, comments, location)
  @environment = environment
  @ast = ast
  @comments = comments
  @location = location
end

Instance Attribute Details

#ast ⇒ Object (readonly)

Returns the value of attribute ast.



10
11
12
# File 'lib/yoda/services/comment_completion/base_provider.rb', line 10

def ast
  @ast
end

#comments ⇒ Object (readonly)

Returns the value of attribute comments.



13
14
15
# File 'lib/yoda/services/comment_completion/base_provider.rb', line 13

def comments
  @comments
end

#environment ⇒ Object (readonly)

Returns the value of attribute environment.



7
8
9
# File 'lib/yoda/services/comment_completion/base_provider.rb', line 7

def environment
  @environment
end

#location ⇒ Object (readonly)

Returns the value of attribute location.



16
17
18
# File 'lib/yoda/services/comment_completion/base_provider.rb', line 16

def location
  @location
end

Instance Method Details

#available? ⇒ true, false

This method is abstract.

Returns:

  • (true, false)


31
32
33
# File 'lib/yoda/services/comment_completion/base_provider.rb', line 31

def available?
  fail NotImplementedError
end

#candidates ⇒ Array<Model::CompletionItem>

This method is abstract.

Returns:



37
38
39
# File 'lib/yoda/services/comment_completion/base_provider.rb', line 37

def candidates
  fail NotImplementedError
end