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


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

def initialize(source)
  @handlers = []
  @source = source
  @setup_blocks = []
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

#setup_blocksObject

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 setup_blocks
  @setup_blocks
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.


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

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

Instance Method Details

#setup(client) ⇒ 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.


27
28
29
# File 'lib/neovim/plugin.rb', line 27

def setup(client)
  @setup_blocks.each { |bl| bl.call(client) }
end

#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.


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

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