Sha256: 6176bc61fd1dd81eda4ae7b70b83b494ddb04a6fa61beb4b797edfe3e80532db

Contents?: true

Size: 736 Bytes

Versions: 7

Compression:

Stored size: 736 Bytes

Contents

module LanguageServer
  module Protocol
    module Interfaces
      class NotificationMessage
        def initialize(method:, params: nil)
          @attributes = {}

          @attributes[:method] = method
          @attributes[:params] = params if params

          @attributes.freeze
        end

        #
        # The method to be invoked.
        #
        # @return [string]
        def method
          attributes.fetch(:method)
        end

        #
        # The notification's params.
        #
        # @return [any]
        def params
          attributes.fetch(:params)
        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/notification_message.rb
language_server-protocol-0.1.0 lib/language_server/protocol/interfaces/notification_message.rb
language_server-0.4.0 lib/language_server/protocol/interfaces/notification_message.rb
language_server-0.3.1 lib/language_server/protocol/interfaces/notification_message.rb
language_server-0.3.0 lib/language_server/protocol/interfaces/notification_message.rb
language_server-0.2.0 lib/language_server/protocol/interfaces/notification_message.rb
language_server-0.1.0 lib/language_server/protocol/interfaces/notification_message.rb