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.


97
98
99
# File 'lib/tomlrb/handler.rb', line 97

def initialize
  @keys = {}
end

Instance Method Details

#<<(keys) ⇒ Object


109
110
111
112
113
114
# File 'lib/tomlrb/handler.rb', line 109

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


105
106
107
# File 'lib/tomlrb/handler.rb', line 105

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

#add_table_key(keys, is_array_of_tables = false) ⇒ Object


101
102
103
# File 'lib/tomlrb/handler.rb', line 101

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