Class: Neovim::RemoteObject
Constant Summary
collapse
- TRANSFER =
MPLight::Types.new
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
#get_option, #option_params, #set_option
Constructor Details
#initialize(index, client) ⇒ RemoteObject
Returns a new instance of RemoteObject.
65
66
67
|
# File 'lib/neovim/remote_object.rb', line 65
def initialize index, client
@index, @client = index, client
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(sym, *args) ⇒ Object
107
108
109
110
111
|
# File 'lib/neovim/remote_object.rb', line 107
def method_missing sym, *args
call_obj sym, *args
rescue UnknownApiObjectFunction
super
end
|
Instance Attribute Details
Returns the value of attribute client.
63
64
65
|
# File 'lib/neovim/remote_object.rb', line 63
def client
@client
end
|
Returns the value of attribute index.
63
64
65
|
# File 'lib/neovim/remote_object.rb', line 63
def index
@index
end
|
Class Method Details
.from_mpdata(data, client) ⇒ Object
86
87
88
89
90
|
# File 'lib/neovim/remote_object.rb', line 86
def from_mpdata data, client
b = MPLight::BufferIO.new data
index = TRANSFER.do_input b do TRANSFER.get end
new index, client
end
|
.new(index, client) ⇒ Object
47
48
49
50
51
52
53
54
55
|
# File 'lib/neovim/remote_object.rb', line 47
def new index, client
@objs ||= []
i = @objs.find { |s| s.index == index && s.client == client }
unless i then
i = plain_new index, client
@objs.push i
end
i
end
|
.plain_new ⇒ Object
46
|
# File 'lib/neovim/remote_object.rb', line 46
alias plain_new new
|
57
58
59
|
# File 'lib/neovim/remote_object.rb', line 57
def type
@type ||= plain_name.to_sym
end
|
Instance Method Details
#==(other) ⇒ Object
93
94
95
|
# File 'lib/neovim/remote_object.rb', line 93
def == other
(other.class.equal? self.class) && @index == other.index && @client == other.client
end
|
#call_api(name, *args, &block) ⇒ Object
98
99
100
|
# File 'lib/neovim/remote_object.rb', line 98
def call_api name, *args, &block
@client.call_api name, *args, &block
end
|
#call_obj(name, *args, &block) ⇒ Object
102
103
104
|
# File 'lib/neovim/remote_object.rb', line 102
def call_obj name, *args, &block
@client.call_obj self, name, *args, &block
end
|
73
74
75
|
# File 'lib/neovim/remote_object.rb', line 73
def inspect
"#<#{self.class}:#{self.object_id} #@index>"
end
|
#methods(regular = true) ⇒ Object
117
118
119
120
121
|
# File 'lib/neovim/remote_object.rb', line 117
def methods regular = true
s = super
s |= @client.obj_functions self if regular
s
end
|
#respond_to_missing?(sym, priv = nil) ⇒ Boolean
113
114
115
|
# File 'lib/neovim/remote_object.rb', line 113
def respond_to_missing? sym, priv = nil
@client.has_obj_function? self, sym
end
|
#to_mpdata(packer = nil) ⇒ Object
80
81
82
83
84
|
# File 'lib/neovim/remote_object.rb', line 80
def to_mpdata packer = nil
b = MPLight::BufferIO.new
TRANSFER.do_output b do TRANSFER.put @index end
b.data
end
|
69
70
71
|
# File 'lib/neovim/remote_object.rb', line 69
def type
self.class.type
end
|