Class: Neovim::Plugin Private

Inherits:
Object
  • Object
show all
Defined in:
lib/neovim/plugin.rb,
lib/neovim/plugin/dsl.rb,
lib/neovim/plugin/handler.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Defined Under Namespace

Classes: DSL, Handler

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(source) ⇒ Plugin

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Plugin.



16
17
18
19
# File 'lib/neovim/plugin.rb', line 16

def initialize(source)
  @handlers = []
  @source = source
end

Instance Attribute Details

#handlersObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



6
7
8
# File 'lib/neovim/plugin.rb', line 6

def handlers
  @handlers
end

#sourceObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



7
8
9
# File 'lib/neovim/plugin.rb', line 7

def source
  @source
end

Class Method Details

.from_config_block(source) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Entrypoint to the Neovim.plugin DSL.



10
11
12
13
14
# File 'lib/neovim/plugin.rb', line 10

def self.from_config_block(source)
  new(source).tap do |instance|
    yield DSL.new(instance) if block_given?
  end
end

Instance Method Details

#specsObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Return specs used by nvim to register plugins.



22
23
24
25
26
# File 'lib/neovim/plugin.rb', line 22

def specs
  @handlers.inject([]) do |acc, handler|
    handler.qualified? ? acc + [handler.to_spec] : acc
  end
end