Class: Neovim::Plugin::Handler Private
- Inherits:
-
Object
- Object
- Neovim::Plugin::Handler
- Defined in:
- 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.
Instance Attribute Summary collapse
- #block ⇒ Object readonly private
Class Method Summary collapse
Instance Method Summary collapse
- #call(*args) ⇒ Object private
-
#initialize(source, type, name, sync, options, block) ⇒ Handler
constructor
private
A new instance of Handler.
- #qualified? ⇒ Boolean private
- #qualified_name ⇒ Object private
- #sync? ⇒ Boolean private
- #to_spec ⇒ Object private
Constructor Details
#initialize(source, type, name, sync, options, block) ⇒ Handler
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 Handler.
18 19 20 21 22 23 24 25 26 27 |
# File 'lib/neovim/plugin/handler.rb', line 18 def initialize(source, type, name, sync, , block) @source = source @type = type.to_sym if type.respond_to?(:to_sym) @name = name.to_s @sync = !!sync @options = @block = block || Proc.new {} @qualified = .key?(:qualified) ? .delete(:qualified) : true end |
Instance Attribute Details
#block ⇒ 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.
5 6 7 |
# File 'lib/neovim/plugin/handler.rb', line 5 def block @block end |
Class Method Details
.unqualified(name, sync, options, block) ⇒ 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.
7 8 9 10 11 12 13 14 15 16 |
# File 'lib/neovim/plugin/handler.rb', line 7 def self.unqualified(name, sync, , block) new( nil, nil, name, sync, .merge(:qualified => false), block ) end |
Instance Method Details
#call(*args) ⇒ 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.
57 58 59 |
# File 'lib/neovim/plugin/handler.rb', line 57 def call(*args) @block.call(*args) end |
#qualified? ⇒ 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.
33 34 35 |
# File 'lib/neovim/plugin/handler.rb', line 33 def qualified? @qualified end |
#qualified_name ⇒ 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.
37 38 39 40 41 42 43 44 45 46 |
# File 'lib/neovim/plugin/handler.rb', line 37 def qualified_name return @name unless qualified? if @type == :autocmd pattern = @options.fetch(:pattern, "*") "#{@source}:#{@type}:#{@name}:#{pattern}" else "#{@source}:#{@type}:#{@name}" end end |
#sync? ⇒ 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.
29 30 31 |
# File 'lib/neovim/plugin/handler.rb', line 29 def sync? @sync end |
#to_spec ⇒ 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.
48 49 50 51 52 53 54 55 |
# File 'lib/neovim/plugin/handler.rb', line 48 def to_spec { :type => @type, :name => @name, :sync => @sync, :opts => @options, } end |