Class: Tomlrb::Keys

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

Instance Method Summary collapse

Constructor Details

#initializeKeys

Returns a new instance of Keys.



143
144
145
# File 'lib/tomlrb/handler.rb', line 143

def initialize
  @keys = {}
end

Instance Method Details

#<<(keys) ⇒ Object



155
156
157
158
159
160
# File 'lib/tomlrb/handler.rb', line 155

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



151
152
153
# File 'lib/tomlrb/handler.rb', line 151

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

#add_table_key(keys, is_array_of_tables = false) ⇒ Object



147
148
149
# File 'lib/tomlrb/handler.rb', line 147

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