lib/neovim/remote_object.rb in neovim-0.4.0 vs lib/neovim/remote_object.rb in neovim-0.5.0

- old
+ new

@@ -21,11 +21,11 @@ packer.pack(@index) end # Intercept method calls and delegate to appropriate RPC methods. def method_missing(method_name, *args) - if func = @api.function(qualify(method_name)) + if func = @api.function_for_object_method(self, method_name) func.call(@session, @index, *args) else super end end @@ -34,11 +34,11 @@ def respond_to?(method_name) super || rpc_methods.include?(method_name.to_sym) end # Extend +methods+ to include RPC methods - def methods + def methods(*args) super | rpc_methods end # Extend +==+ to only look at class and index. def ==(other) @@ -46,19 +46,9 @@ end private def rpc_methods - @api.functions_with_prefix(function_prefix).map do |func| - func.name.sub(/\A#{function_prefix}/, "").to_sym - end - end - - def function_prefix - "#{self.class.to_s.split("::").last.downcase}_" - end - - def qualify(method_name) - :"#{function_prefix}#{method_name}" + @api.functions_for_object(self).map(&:method_name) end end end