Sha256: 3bf9f63223d2aad59a2cc3e1b94ed07d4d4562018e6b856385a200b2c0f412ae

Contents?: true

Size: 977 Bytes

Versions: 7

Compression:

Stored size: 977 Bytes

Contents

module LanguageServer
  module Protocol
    module Interfaces
      class ShowMessageRequestParams
        def initialize(type:, message:, actions: nil)
          @attributes = {}

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

          @attributes.freeze
        end

        #
        # The message type. See {@link MessageType}
        #
        # @return [number]
        def type
          attributes.fetch(:type)
        end

        #
        # The actual message
        #
        # @return [string]
        def message
          attributes.fetch(:message)
        end

        #
        # The message action items to present.
        #
        # @return [MessageActionItem[]]
        def actions
          attributes.fetch(:actions)
        end

        attr_reader :attributes

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

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
language_server-protocol-0.2.0 lib/language_server/protocol/interfaces/show_message_request_params.rb
language_server-protocol-0.1.0 lib/language_server/protocol/interfaces/show_message_request_params.rb
language_server-0.4.0 lib/language_server/protocol/interfaces/show_message_request_params.rb
language_server-0.3.1 lib/language_server/protocol/interfaces/show_message_request_params.rb
language_server-0.3.0 lib/language_server/protocol/interfaces/show_message_request_params.rb
language_server-0.2.0 lib/language_server/protocol/interfaces/show_message_request_params.rb
language_server-0.1.0 lib/language_server/protocol/interfaces/show_message_request_params.rb