Class: LanguageServer::Protocol::Interface::ColorPresentationParams
- Inherits:
-
Object
- Object
- LanguageServer::Protocol::Interface::ColorPresentationParams
- Defined in:
- lib/language_server/protocol/interface/color_presentation_params.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
Instance Method Summary collapse
-
#color ⇒ Color
The color information to request presentations for.
-
#initialize(text_document:, color:, range:) ⇒ ColorPresentationParams
constructor
A new instance of ColorPresentationParams.
-
#range ⇒ Range
The range where the color would be inserted.
-
#text_document ⇒ TextDocumentIdentifier
The text document.
- #to_hash ⇒ Object
- #to_json(*args) ⇒ Object
Constructor Details
#initialize(text_document:, color:, range:) ⇒ ColorPresentationParams
Returns a new instance of ColorPresentationParams.
5 6 7 8 9 10 11 12 13 |
# File 'lib/language_server/protocol/interface/color_presentation_params.rb', line 5 def initialize(text_document:, color:, range:) @attributes = {} @attributes[:textDocument] = text_document @attributes[:color] = color @attributes[:range] = range @attributes.freeze end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
39 40 41 |
# File 'lib/language_server/protocol/interface/color_presentation_params.rb', line 39 def attributes @attributes end |
Instance Method Details
#color ⇒ Color
The color information to request presentations for.
27 28 29 |
# File 'lib/language_server/protocol/interface/color_presentation_params.rb', line 27 def color attributes.fetch(:color) end |
#range ⇒ Range
The range where the color would be inserted. Serves as a context.
35 36 37 |
# File 'lib/language_server/protocol/interface/color_presentation_params.rb', line 35 def range attributes.fetch(:range) end |
#text_document ⇒ TextDocumentIdentifier
The text document.
19 20 21 |
# File 'lib/language_server/protocol/interface/color_presentation_params.rb', line 19 def text_document attributes.fetch(:textDocument) end |
#to_hash ⇒ Object
41 42 43 |
# File 'lib/language_server/protocol/interface/color_presentation_params.rb', line 41 def to_hash attributes end |
#to_json(*args) ⇒ Object
45 46 47 |
# File 'lib/language_server/protocol/interface/color_presentation_params.rb', line 45 def to_json(*args) to_hash.to_json(*args) end |