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

Version Path
harbr-2.8.1 vendor/bundle/ruby/3.2.0/gems/toml-rb-2.2.0/lib/toml-rb/inline_table.rb
toml-rb-3.0.1 lib/toml-rb/inline_table.rb
toml-rb-3.0.0 lib/toml-rb/inline_table.rb
harbr-0.2.10 vendor/bundle/ruby/3.2.0/gems/toml-rb-2.2.0/lib/toml-rb/inline_table.rb
harbr-0.2.9 vendor/bundle/ruby/3.2.0/gems/toml-rb-2.2.0/lib/toml-rb/inline_table.rb
harbr-0.2.8 vendor/bundle/ruby/3.2.0/gems/toml-rb-2.2.0/lib/toml-rb/inline_table.rb
harbr-0.2.7 vendor/bundle/ruby/3.2.0/gems/toml-rb-2.2.0/lib/toml-rb/inline_table.rb
harbr-0.2.6 vendor/bundle/ruby/3.2.0/gems/toml-rb-2.2.0/lib/toml-rb/inline_table.rb
harbr-0.2.5 vendor/bundle/ruby/3.2.0/gems/toml-rb-2.2.0/lib/toml-rb/inline_table.rb
harbr-0.2.4 vendor/bundle/ruby/3.2.0/gems/toml-rb-2.2.0/lib/toml-rb/inline_table.rb
harbr-0.2.3 vendor/bundle/ruby/3.2.0/gems/toml-rb-2.2.0/lib/toml-rb/inline_table.rb
harbr-0.2.2 vendor/bundle/ruby/3.2.0/gems/toml-rb-2.2.0/lib/toml-rb/inline_table.rb
harbr-0.2.1 vendor/bundle/ruby/3.2.0/gems/toml-rb-2.2.0/lib/toml-rb/inline_table.rb
harbr-0.2.0 vendor/bundle/ruby/3.2.0/gems/toml-rb-2.2.0/lib/toml-rb/inline_table.rb
harbr-0.1.99 vendor/bundle/ruby/3.2.0/gems/toml-rb-2.2.0/lib/toml-rb/inline_table.rb
harbr-0.1.98 vendor/bundle/ruby/3.2.0/gems/toml-rb-2.2.0/lib/toml-rb/inline_table.rb
harbr-0.1.97 vendor/bundle/ruby/3.2.0/gems/toml-rb-2.2.0/lib/toml-rb/inline_table.rb
harbr-0.1.96 vendor/bundle/ruby/3.2.0/gems/toml-rb-2.2.0/lib/toml-rb/inline_table.rb
harbr-0.1.95 vendor/bundle/ruby/3.2.0/gems/toml-rb-2.2.0/lib/toml-rb/inline_table.rb
harbr-0.1.94 vendor/bundle/ruby/3.2.0/gems/toml-rb-2.2.0/lib/toml-rb/inline_table.rb