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.



132
133
134
# File 'lib/tomlrb/handler.rb', line 132

def initialize
  @keys = {}
end

Instance Method Details

#<<(keys) ⇒ Object



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

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



140
141
142
# File 'lib/tomlrb/handler.rb', line 140

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

#add_table_key(keys, is_array_of_tables = false) ⇒ Object



136
137
138
# File 'lib/tomlrb/handler.rb', line 136

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