Class: LanguageServer::Protocol::Interface::LogTraceParams

Inherits:
Object
  • Object
show all
Defined in:
lib/language_server/protocol/interface/log_trace_params.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message:, verbose: nil) ⇒ LogTraceParams

Returns a new instance of LogTraceParams.



5
6
7
8
9
10
11
12
# File 'lib/language_server/protocol/interface/log_trace_params.rb', line 5

def initialize(message:, verbose: nil)
  @attributes = {}

  @attributes[:message] = message
  @attributes[:verbose] = verbose if verbose

  @attributes.freeze
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



31
32
33
# File 'lib/language_server/protocol/interface/log_trace_params.rb', line 31

def attributes
  @attributes
end

Instance Method Details

#messagestring

The message to be logged.

Returns:

  • (string)


18
19
20
# File 'lib/language_server/protocol/interface/log_trace_params.rb', line 18

def message
  attributes.fetch(:message)
end

#to_hashObject



33
34
35
# File 'lib/language_server/protocol/interface/log_trace_params.rb', line 33

def to_hash
  attributes
end

#to_json(*args) ⇒ Object



37
38
39
# File 'lib/language_server/protocol/interface/log_trace_params.rb', line 37

def to_json(*args)
  to_hash.to_json(*args)
end

#verbosestring

Additional information that can be computed if the ‘trace` configuration is set to `’verbose’‘

Returns:

  • (string)


27
28
29
# File 'lib/language_server/protocol/interface/log_trace_params.rb', line 27

def verbose
  attributes.fetch(:verbose)
end