Class: Holistic::LanguageServer::Request

Inherits:
Struct
  • Object
show all
Defined in:
lib/holistic/language_server/request.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#applicationObject

Returns the value of attribute application

Returns:

  • (Object)

    the current value of application



4
5
6
# File 'lib/holistic/language_server/request.rb', line 4

def application
  @application
end

#messageObject

Returns the value of attribute message

Returns:

  • (Object)

    the current value of message



4
5
6
# File 'lib/holistic/language_server/request.rb', line 4

def message
  @message
end

#responseObject

Returns the value of attribute response

Returns:

  • (Object)

    the current value of response



4
5
6
# File 'lib/holistic/language_server/request.rb', line 4

def response
  @response
end

Instance Method Details

#dropObject



13
14
15
# File 'lib/holistic/language_server/request.rb', line 13

def drop
  self.response = Response::Drop.new
end

#param(*keys) ⇒ Object



17
18
19
# File 'lib/holistic/language_server/request.rb', line 17

def param(*keys)
  message.param(*keys)
end

#respond_with(result) ⇒ Object



5
6
7
# File 'lib/holistic/language_server/request.rb', line 5

def respond_with(result)
  self.response = Response::Success.new(message_id: message.id, result:)
end

#respond_with_error(code:, description: nil, data: nil) ⇒ Object



9
10
11
# File 'lib/holistic/language_server/request.rb', line 9

def respond_with_error(code:, description: nil, data: nil)
  self.response = Response::Error.new(message_id: message.id, code:, message: description, data:)
end