Class: TwitterCldr::Utils::FileSystemTrie::Node
- Inherits:
-
Object
- Object
- TwitterCldr::Utils::FileSystemTrie::Node
- Defined in:
- lib/twitter_cldr/utils/file_system_trie.rb
Instance Attribute Summary collapse
-
#children ⇒ Object
Returns the value of attribute children.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
- #child(key) ⇒ Object
- #each_key_and_child(&block) ⇒ Object
- #has_children? ⇒ Boolean
-
#initialize(value = nil, children = {}) ⇒ Node
constructor
A new instance of Node.
- #keys ⇒ Object
- #set_child(key, child) ⇒ Object
- #to_trie ⇒ Object
Constructor Details
#initialize(value = nil, children = {}) ⇒ Node
Returns a new instance of Node.
112 113 114 115 |
# File 'lib/twitter_cldr/utils/file_system_trie.rb', line 112 def initialize(value = nil, children = {}) @value = value @children = children end |
Instance Attribute Details
#children ⇒ Object
Returns the value of attribute children.
110 111 112 |
# File 'lib/twitter_cldr/utils/file_system_trie.rb', line 110 def children @children end |
#value ⇒ Object
Returns the value of attribute value.
110 111 112 |
# File 'lib/twitter_cldr/utils/file_system_trie.rb', line 110 def value @value end |
Instance Method Details
#child(key) ⇒ Object
117 118 119 |
# File 'lib/twitter_cldr/utils/file_system_trie.rb', line 117 def child(key) @children[key] end |
#each_key_and_child(&block) ⇒ Object
129 130 131 |
# File 'lib/twitter_cldr/utils/file_system_trie.rb', line 129 def each_key_and_child(&block) @children.each(&block) end |
#has_children? ⇒ Boolean
125 126 127 |
# File 'lib/twitter_cldr/utils/file_system_trie.rb', line 125 def has_children? !@children.empty? end |
#keys ⇒ Object
133 134 135 |
# File 'lib/twitter_cldr/utils/file_system_trie.rb', line 133 def keys @children.keys end |
#set_child(key, child) ⇒ Object
121 122 123 |
# File 'lib/twitter_cldr/utils/file_system_trie.rb', line 121 def set_child(key, child) @children[key] = child end |