Class: Neovim::API::Function
- Inherits:
-
Struct
- Object
- Struct
- Neovim::API::Function
- Defined in:
- lib/neovim/api.rb
Overview
Encapsulate an RPC function.
Instance Attribute Summary collapse
-
#async ⇒ Object
Returns the value of attribute async.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
-
#call(session, *args) ⇒ Object?
Apply this function to a running RPC session.
Instance Attribute Details
#async ⇒ Object
Returns the value of attribute async
68 69 70 |
# File 'lib/neovim/api.rb', line 68 def async @async end |
#name ⇒ Object
Returns the value of attribute name
68 69 70 |
# File 'lib/neovim/api.rb', line 68 def name @name end |
Instance Method Details
#call(session, *args) ⇒ Object?
Apply this function to a running RPC session. Sends either a request if async
is false
or a notification if async
is true
.
75 76 77 78 79 80 81 |
# File 'lib/neovim/api.rb', line 75 def call(session, *args) if async session.notify(name, *args) else session.request(name, *args) end end |