Class: PuppetLanguageServer::SessionState::Document
- Inherits:
-
Object
- Object
- PuppetLanguageServer::SessionState::Document
- Defined in:
- lib/puppet-languageserver/session_state/document_store.rb
Overview
Represents a Document in the Document Store. Can be subclassed to add additional methods and helpers
Direct Known Subclasses
Instance Attribute Summary collapse
-
#content ⇒ Object
readonly
Returns the value of attribute content.
-
#tokens ⇒ Object
readonly
Returns the value of attribute tokens.
-
#uri ⇒ Object
readonly
Returns the value of attribute uri.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Instance Method Summary collapse
-
#calculate_tokens! ⇒ Object
Subclass this!.
-
#initialize(uri, content, version) ⇒ Document
constructor
A new instance of Document.
-
#update(content, version) ⇒ Object
Update a document with new content and version.
Constructor Details
#initialize(uri, content, version) ⇒ Document
Returns a new instance of Document.
13 14 15 16 17 18 |
# File 'lib/puppet-languageserver/session_state/document_store.rb', line 13 def initialize(uri, content, version) @uri = uri @content = content @version = version @tokens = nil end |
Instance Attribute Details
#content ⇒ Object (readonly)
Returns the value of attribute content.
8 9 10 |
# File 'lib/puppet-languageserver/session_state/document_store.rb', line 8 def content @content end |
#tokens ⇒ Object (readonly)
Returns the value of attribute tokens.
8 9 10 |
# File 'lib/puppet-languageserver/session_state/document_store.rb', line 8 def tokens @tokens end |
#uri ⇒ Object (readonly)
Returns the value of attribute uri.
8 9 10 |
# File 'lib/puppet-languageserver/session_state/document_store.rb', line 8 def uri @uri end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
8 9 10 |
# File 'lib/puppet-languageserver/session_state/document_store.rb', line 8 def version @version end |
Instance Method Details
#calculate_tokens! ⇒ Object
Subclass this!
30 31 32 |
# File 'lib/puppet-languageserver/session_state/document_store.rb', line 30 def calculate_tokens! [] end |
#update(content, version) ⇒ Object
Update a document with new content and version
23 24 25 26 27 |
# File 'lib/puppet-languageserver/session_state/document_store.rb', line 23 def update(content, version) @content = content @version = version @tokens = nil end |