Class: LanguageServer::Protocol::Interface::VersionedTextDocumentIdentifier
- Inherits:
-
Object
- Object
- LanguageServer::Protocol::Interface::VersionedTextDocumentIdentifier
- Defined in:
- lib/language_server/protocol/interface/versioned_text_document_identifier.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
Instance Method Summary collapse
-
#initialize(uri:, version:) ⇒ VersionedTextDocumentIdentifier
constructor
A new instance of VersionedTextDocumentIdentifier.
- #to_hash ⇒ Object
- #to_json(*args) ⇒ Object
-
#uri ⇒ string
The text document’s URI.
-
#version ⇒ number
The version number of this document.
Constructor Details
#initialize(uri:, version:) ⇒ VersionedTextDocumentIdentifier
Returns a new instance of VersionedTextDocumentIdentifier.
5 6 7 8 9 10 11 12 |
# File 'lib/language_server/protocol/interface/versioned_text_document_identifier.rb', line 5 def initialize(uri:, version:) @attributes = {} @attributes[:uri] = uri @attributes[:version] = version @attributes.freeze end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
33 34 35 |
# File 'lib/language_server/protocol/interface/versioned_text_document_identifier.rb', line 33 def attributes @attributes end |
Instance Method Details
#to_hash ⇒ Object
35 36 37 |
# File 'lib/language_server/protocol/interface/versioned_text_document_identifier.rb', line 35 def to_hash attributes end |
#to_json(*args) ⇒ Object
39 40 41 |
# File 'lib/language_server/protocol/interface/versioned_text_document_identifier.rb', line 39 def to_json(*args) to_hash.to_json(*args) end |
#uri ⇒ string
The text document’s URI.
18 19 20 |
# File 'lib/language_server/protocol/interface/versioned_text_document_identifier.rb', line 18 def uri attributes.fetch(:uri) end |
#version ⇒ number
The version number of this document.
The version number of a document will increase after each change, including undo/redo. The number doesn’t need to be consecutive.
29 30 31 |
# File 'lib/language_server/protocol/interface/versioned_text_document_identifier.rb', line 29 def version attributes.fetch(:version) end |