Class: RubyLsp::Requests::Support::PrefixTree::Node
- Inherits:
-
Object
- Object
- RubyLsp::Requests::Support::PrefixTree::Node
- Extended by:
- T::Sig
- Defined in:
- lib/ruby_lsp/requests/support/prefix_tree.rb
Instance Attribute Summary collapse
-
#children ⇒ Object
readonly
Returns the value of attribute children.
-
#leaf ⇒ Object
Returns the value of attribute leaf.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #collect ⇒ Object
-
#initialize(value) ⇒ Node
constructor
A new instance of Node.
Constructor Details
Instance Attribute Details
#children ⇒ Object (readonly)
Returns the value of attribute children.
50 51 52 |
# File 'lib/ruby_lsp/requests/support/prefix_tree.rb', line 50 def children @children end |
#leaf ⇒ Object
Returns the value of attribute leaf.
56 57 58 |
# File 'lib/ruby_lsp/requests/support/prefix_tree.rb', line 56 def leaf @leaf end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
53 54 55 |
# File 'lib/ruby_lsp/requests/support/prefix_tree.rb', line 53 def value @value end |
Instance Method Details
#collect ⇒ Object
66 67 68 69 70 71 72 73 74 75 |
# File 'lib/ruby_lsp/requests/support/prefix_tree.rb', line 66 def collect result = T.let([], T::Array[String]) result << value if leaf children.each_value do |node| result.concat(node.collect) end result end |