Class: Neovim::Handler
Direct Known Subclasses
Instance Attribute Summary collapse
-
#spec ⇒ Object
readonly
Returns the value of attribute spec.
Instance Method Summary collapse
- #execute(*args) ⇒ Object
-
#initialize(name, type = nil, sync = nil, **options, &block) ⇒ Handler
constructor
A new instance of Handler.
- #name ⇒ Object
- #needs_client? ⇒ Boolean
- #opts ⇒ Object (also: #options)
- #sync ⇒ Object (also: #sync?)
Constructor Details
#initialize(name, type = nil, sync = nil, **options, &block) ⇒ Handler
Returns a new instance of Handler.
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/neovim/handler.rb', line 14 def initialize name, type = nil, sync = nil, **, &block @block = block standardize @spec = { name: name, opts: , type: type, sync: sync, } @spec.compact! end |
Instance Attribute Details
#spec ⇒ Object (readonly)
Returns the value of attribute spec.
12 13 14 |
# File 'lib/neovim/handler.rb', line 12 def spec @spec end |
Instance Method Details
#execute(*args) ⇒ Object
33 |
# File 'lib/neovim/handler.rb', line 33 def execute *args ; @block.call *args ; end |
#name ⇒ Object
26 |
# File 'lib/neovim/handler.rb', line 26 def name ; @spec[ :name] ; end |
#needs_client? ⇒ Boolean
32 |
# File 'lib/neovim/handler.rb', line 32 def needs_client? ; true ; end |
#opts ⇒ Object Also known as: options
27 |
# File 'lib/neovim/handler.rb', line 27 def opts ; @spec[ :opts] ; end |
#sync ⇒ Object Also known as: sync?
29 |
# File 'lib/neovim/handler.rb', line 29 def sync ; @spec[ :sync] ; end |