Sha256: 3c78c70c430478fc235dfb39e93ff9e5129dfce1e22fc019fd389e09cdaee93a

Contents?: true

Size: 806 Bytes

Versions: 7

Compression:

Stored size: 806 Bytes

Contents

module LanguageServer
  module Protocol
    module Interfaces
      class ExecuteCommandParams
        def initialize(command:, arguments: nil)
          @attributes = {}

          @attributes[:command] = command
          @attributes[:arguments] = arguments if arguments

          @attributes.freeze
        end

        #
        # The identifier of the actual command handler.
        #
        # @return [string]
        def command
          attributes.fetch(:command)
        end

        #
        # Arguments that the command should be invoked with.
        #
        # @return [any[]]
        def arguments
          attributes.fetch(:arguments)
        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/execute_command_params.rb
language_server-protocol-0.1.0 lib/language_server/protocol/interfaces/execute_command_params.rb
language_server-0.4.0 lib/language_server/protocol/interfaces/execute_command_params.rb
language_server-0.3.1 lib/language_server/protocol/interfaces/execute_command_params.rb
language_server-0.3.0 lib/language_server/protocol/interfaces/execute_command_params.rb
language_server-0.2.0 lib/language_server/protocol/interfaces/execute_command_params.rb
language_server-0.1.0 lib/language_server/protocol/interfaces/execute_command_params.rb