Class: Tomlrb::Keys

Inherits:
Object
  • Object
show all
Defined in:
lib/llm/shell/internal/tomlrb/lib/tomlrb/handler.rb

Instance Method Summary collapse

Constructor Details

#initializeKeys

Returns a new instance of Keys.



134
135
136
# File 'lib/llm/shell/internal/tomlrb/lib/tomlrb/handler.rb', line 134

def initialize
  @keys = {}
end

Instance Method Details

#<<(keys) ⇒ Object



146
147
148
149
150
151
# File 'lib/llm/shell/internal/tomlrb/lib/tomlrb/handler.rb', line 146

def <<(keys)
  table_keys, pair_keys, is_array_of_tables = keys
  current = @keys
  current = append_table_keys(current, table_keys, pair_keys.empty?, is_array_of_tables)
  append_pair_keys(current, pair_keys, table_keys.empty?, is_array_of_tables)
end

#add_pair_key(keys, context) ⇒ Object



142
143
144
# File 'lib/llm/shell/internal/tomlrb/lib/tomlrb/handler.rb', line 142

def add_pair_key(keys, context)
  self << [context, keys, false]
end

#add_table_key(keys, is_array_of_tables = false) ⇒ Object



138
139
140
# File 'lib/llm/shell/internal/tomlrb/lib/tomlrb/handler.rb', line 138

def add_table_key(keys, is_array_of_tables = false)
  self << [keys, [], is_array_of_tables]
end