Class: LanguageServer::Protocol::Interface::ResourceOperation
- Inherits:
-
Object
- Object
- LanguageServer::Protocol::Interface::ResourceOperation
- Defined in:
- lib/language_server/protocol/interface/resource_operation.rb
Overview
A generic resource operation.
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
Instance Method Summary collapse
-
#annotation_id ⇒ ChangeAnnotationIdentifier | nil
An optional annotation identifier describing the operation.
-
#initialize(kind:, annotation_id: nil) ⇒ ResourceOperation
constructor
A new instance of ResourceOperation.
-
#kind ⇒ string
The resource operation kind.
- #to_hash ⇒ Object
- #to_json(*args) ⇒ Object
Constructor Details
#initialize(kind:, annotation_id: nil) ⇒ ResourceOperation
Returns a new instance of ResourceOperation.
8 9 10 11 12 13 14 15 |
# File 'lib/language_server/protocol/interface/resource_operation.rb', line 8 def initialize(kind:, annotation_id: nil) @attributes = {} @attributes[:kind] = kind @attributes[:annotationId] = annotation_id if annotation_id @attributes.freeze end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
35 36 37 |
# File 'lib/language_server/protocol/interface/resource_operation.rb', line 35 def attributes @attributes end |
Instance Method Details
#annotation_id ⇒ ChangeAnnotationIdentifier | nil
An optional annotation identifier describing the operation.
31 32 33 |
# File 'lib/language_server/protocol/interface/resource_operation.rb', line 31 def annotation_id attributes.fetch(:annotationId) end |
#kind ⇒ string
The resource operation kind.
21 22 23 |
# File 'lib/language_server/protocol/interface/resource_operation.rb', line 21 def kind attributes.fetch(:kind) end |
#to_hash ⇒ Object
37 38 39 |
# File 'lib/language_server/protocol/interface/resource_operation.rb', line 37 def to_hash attributes end |
#to_json(*args) ⇒ Object
41 42 43 |
# File 'lib/language_server/protocol/interface/resource_operation.rb', line 41 def to_json(*args) to_hash.to_json(*args) end |