Class: Samovar::Completion::Provider

Inherits:
Object
  • Object
show all
Defined in:
lib/samovar/completion/provider.rb

Overview

Expands static, dynamic, and native completion providers.

Instance Method Summary collapse

Constructor Details

#initialize(context, completions) ⇒ Provider

Initialize a new completion provider.



17
18
19
20
# File 'lib/samovar/completion/provider.rb', line 17

def initialize(context, completions)
	@context = context
	@completions = completions
end

Instance Method Details

#suggestionsObject

Generate suggestions from the provider.



25
26
27
28
29
30
31
32
33
34
# File 'lib/samovar/completion/provider.rb', line 25

def suggestions
	case @completions
	when nil
		Result.new
	when Symbol
		native_suggestions
	else
		matching_suggestions
	end
end