Sha256: ee90911324b6f9b62679981b94b46dd3df38a88cbb187b9584e3772174bf5cec
Contents?: true
Size: 559 Bytes
Versions: 79
Compression:
Stored size: 559 Bytes
Contents
module TomlRB class InlineTable def initialize(keyvalue_pairs) @pairs = keyvalue_pairs end def accept_visitor(keyvalue) value keyvalue.symbolize_keys end def value(symbolize_keys = false) result = {} @pairs.each do |kv| update = kv.assign({}, [], symbolize_keys) result.merge!(update) { |key, _, _| fail ValueOverwriteError.new(key) } end result end end module InlineTableParser def value TomlRB::InlineTable.new captures[:keyvalue].map(&:value) end end end
Version data entries
79 entries across 79 versions & 2 rubygems