Class: Neovim::ClientInfo Private

Inherits:
Object show all
Defined in:
lib/neovim/client_info.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.

Constant Summary collapse

HOST_METHOD_SPEC =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

{poll: {}, specs: {nargs: 1}}.freeze
ATTRIBUTES =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

{
  website: "https://github.com/neovim/neovim-ruby",
  license: "MIT"
}.freeze

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, type, method_spec, attributes) ⇒ ClientInfo

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



25
26
27
28
29
30
31
32
33
34
# File 'lib/neovim/client_info.rb', line 25

def initialize(name, type, method_spec, attributes)
  @name = name
  @type = type
  @method_spec = method_spec
  @attributes = attributes

  @version = ["major", "minor", "patch"]
    .zip(Neovim::VERSION.segments)
    .to_h
end

Class Method Details

.for_clientObject

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.



21
22
23
# File 'lib/neovim/client_info.rb', line 21

def self.for_client
  new("ruby-client", :remote, {}, ATTRIBUTES)
end

.for_host(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.



13
14
15
16
17
18
19
# File 'lib/neovim/client_info.rb', line 13

def self.for_host(host)
  name = host.plugins.map(&:script_host?) == [true] ?
    "ruby-script-host" :
    "ruby-rplugin-host"

  new(name, :host, HOST_METHOD_SPEC, ATTRIBUTES)
end

Instance Method Details

#to_argsObject

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.



36
37
38
39
40
41
42
43
44
# File 'lib/neovim/client_info.rb', line 36

def to_args
  [
    @name,
    @version,
    @type,
    @method_spec,
    @attributes
  ]
end