Sha256: bc16b3cebe9a03ae612763e2ee85e598fde097b25a0aa7dfb477fa5e99ab35ae

Contents?: true

Size: 805 Bytes

Versions: 2

Compression:

Stored size: 805 Bytes

Contents

module LanguageServer
  module Protocol
    module Interface
      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

2 entries across 2 versions & 1 rubygems

Version Path
language_server-protocol-0.4.0 lib/language_server/protocol/interface/execute_command_params.rb
language_server-protocol-0.3.0 lib/language_server/protocol/interface/execute_command_params.rb