Class: Neovim::Plugin Private

Inherits:
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
20
# File 'lib/neovim/plugin.rb', line 15

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

#script_hostObject

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 script_host
  @script_host
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

#script_host?Boolean

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:

  • (Boolean)


32
33
34
# File 'lib/neovim/plugin.rb', line 32

def script_host?
  !!@script_host
end

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



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

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.



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