Sha256: 58b2953cf7ec53aed080d5b21cde4df3b8ab04bffe926d5e956c60cf7ee52579

Contents?: true

Size: 882 Bytes

Versions: 4

Compression:

Stored size: 882 Bytes

Contents

module LanguageServer
  module Protocol
    module Interface
      #
      # Client capabilities specific to the used markdown parser.
      #
      class MarkdownClientCapabilities
        def initialize(parser:, version: nil)
          @attributes = {}

          @attributes[:parser] = parser
          @attributes[:version] = version if version

          @attributes.freeze
        end

        #
        # The name of the parser.
        #
        # @return [string]
        def parser
          attributes.fetch(:parser)
        end

        #
        # The version of the parser.
        #
        # @return [string]
        def version
          attributes.fetch(:version)
        end

        attr_reader :attributes

        def to_hash
          attributes
        end

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

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
language_server-protocol-3.16.0.3 lib/language_server/protocol/interface/markdown_client_capabilities.rb
language_server-protocol-3.16.0.2 lib/language_server/protocol/interface/markdown_client_capabilities.rb
language_server-protocol-3.16.0.1 lib/language_server/protocol/interface/markdown_client_capabilities.rb
language_server-protocol-3.16.0.0 lib/language_server/protocol/interface/markdown_client_capabilities.rb