Class: LanguageServer::Protocol::Interface::ShowMessageRequestParams

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type:, message:, actions: nil) ⇒ ShowMessageRequestParams

Returns a new instance of ShowMessageRequestParams.



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

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

  @attributes[:type] = type
  @attributes[:message] = message
  @attributes[:actions] = actions if actions

  @attributes.freeze
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



39
40
41
# File 'lib/language_server/protocol/interface/show_message_request_params.rb', line 39

def attributes
  @attributes
end

Instance Method Details

#actionsMessageActionItem[]

The message action items to present.

Returns:



35
36
37
# File 'lib/language_server/protocol/interface/show_message_request_params.rb', line 35

def actions
  attributes.fetch(:actions)
end

#messagestring

The actual message

Returns:

  • (string)


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

def message
  attributes.fetch(:message)
end

#to_hashObject



41
42
43
# File 'lib/language_server/protocol/interface/show_message_request_params.rb', line 41

def to_hash
  attributes
end

#to_json(*args) ⇒ Object



45
46
47
# File 'lib/language_server/protocol/interface/show_message_request_params.rb', line 45

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

#typeMessageType

The message type. See MessageType

Returns:

  • (MessageType)


19
20
21
# File 'lib/language_server/protocol/interface/show_message_request_params.rb', line 19

def type
  attributes.fetch(:type)
end