Class: LanguageServer::Protocol::Interface::SelectionRange
- Inherits:
-
Object
- Object
- LanguageServer::Protocol::Interface::SelectionRange
- Defined in:
- lib/language_server/protocol/interface/selection_range.rb
Overview
A selection range represents a part of a selection hierarchy. A selection range may have a parent selection range that contains it.
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
Instance Method Summary collapse
-
#initialize(range:, parent: nil) ⇒ SelectionRange
constructor
A new instance of SelectionRange.
-
#parent ⇒ SelectionRange | nil
The parent selection range containing this range.
-
#range ⇒ Range
The [range](#Range) of this selection range.
- #to_hash ⇒ Object
- #to_json(*args) ⇒ Object
Constructor Details
#initialize(range:, parent: nil) ⇒ SelectionRange
Returns a new instance of SelectionRange.
9 10 11 12 13 14 15 16 |
# File 'lib/language_server/protocol/interface/selection_range.rb', line 9 def initialize(range:, parent: nil) @attributes = {} @attributes[:range] = range @attributes[:parent] = parent if parent @attributes.freeze end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
34 35 36 |
# File 'lib/language_server/protocol/interface/selection_range.rb', line 34 def attributes @attributes end |
Instance Method Details
#parent ⇒ SelectionRange | nil
The parent selection range containing this range. Therefore parent.range must contain this.range.
30 31 32 |
# File 'lib/language_server/protocol/interface/selection_range.rb', line 30 def parent attributes.fetch(:parent) end |
#range ⇒ Range
The [range](#Range) of this selection range.
22 23 24 |
# File 'lib/language_server/protocol/interface/selection_range.rb', line 22 def range attributes.fetch(:range) end |
#to_hash ⇒ Object
36 37 38 |
# File 'lib/language_server/protocol/interface/selection_range.rb', line 36 def to_hash attributes end |
#to_json(*args) ⇒ Object
40 41 42 |
# File 'lib/language_server/protocol/interface/selection_range.rb', line 40 def to_json(*args) to_hash.to_json(*args) end |