Class: Neovim::Plugin Private
- 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
Instance Attribute Summary collapse
- #handlers ⇒ Object private
- #script_host ⇒ Object private
- #setup_blocks ⇒ Object private
- #source ⇒ Object readonly private
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(source) ⇒ Plugin
constructor
private
A new instance of Plugin.
- #script_host? ⇒ Boolean private
- #setup(client) ⇒ Object private
- #specs ⇒ Object private
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
#handlers ⇒ 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.
6 7 8 |
# File 'lib/neovim/plugin.rb', line 6 def handlers @handlers end |
#script_host ⇒ 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.
6 7 8 |
# File 'lib/neovim/plugin.rb', line 6 def script_host @script_host end |
#setup_blocks ⇒ 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.
6 7 8 |
# File 'lib/neovim/plugin.rb', line 6 def setup_blocks @setup_blocks end |
#source ⇒ Object (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.
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 |
#specs ⇒ 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.
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 |