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-0.1.93 vendor/bundle/ruby/3.2.0/gems/toml-rb-2.2.0/lib/toml-rb/inline_table.rb
harbr-0.1.91 vendor/bundle/ruby/3.2.0/gems/toml-rb-2.2.0/lib/toml-rb/inline_table.rb
harbr-0.1.90 vendor/bundle/ruby/3.2.0/gems/toml-rb-2.2.0/lib/toml-rb/inline_table.rb
harbr-0.1.89 vendor/bundle/ruby/3.2.0/gems/toml-rb-2.2.0/lib/toml-rb/inline_table.rb
harbr-0.1.88 vendor/bundle/ruby/3.2.0/gems/toml-rb-2.2.0/lib/toml-rb/inline_table.rb
harbr-0.1.87 vendor/bundle/ruby/3.2.0/gems/toml-rb-2.2.0/lib/toml-rb/inline_table.rb
harbr-0.1.86 vendor/bundle/ruby/3.2.0/gems/toml-rb-2.2.0/lib/toml-rb/inline_table.rb
harbr-0.1.85 vendor/bundle/ruby/3.2.0/gems/toml-rb-2.2.0/lib/toml-rb/inline_table.rb
harbr-0.1.84 vendor/bundle/ruby/3.2.0/gems/toml-rb-2.2.0/lib/toml-rb/inline_table.rb
harbr-0.1.83 vendor/bundle/ruby/3.2.0/gems/toml-rb-2.2.0/lib/toml-rb/inline_table.rb
harbr-0.1.82 vendor/bundle/ruby/3.2.0/gems/toml-rb-2.2.0/lib/toml-rb/inline_table.rb
harbr-0.1.81 vendor/bundle/ruby/3.2.0/gems/toml-rb-2.2.0/lib/toml-rb/inline_table.rb
harbr-0.1.80 vendor/bundle/ruby/3.2.0/gems/toml-rb-2.2.0/lib/toml-rb/inline_table.rb
harbr-0.1.79 vendor/bundle/ruby/3.2.0/gems/toml-rb-2.2.0/lib/toml-rb/inline_table.rb
harbr-0.1.78 vendor/bundle/ruby/3.2.0/gems/toml-rb-2.2.0/lib/toml-rb/inline_table.rb
harbr-0.1.77 vendor/bundle/ruby/3.2.0/gems/toml-rb-2.2.0/lib/toml-rb/inline_table.rb
harbr-0.1.76 vendor/bundle/ruby/3.2.0/gems/toml-rb-2.2.0/lib/toml-rb/inline_table.rb
harbr-0.1.75 vendor/bundle/ruby/3.2.0/gems/toml-rb-2.2.0/lib/toml-rb/inline_table.rb
harbr-0.1.74 vendor/bundle/ruby/3.2.0/gems/toml-rb-2.2.0/lib/toml-rb/inline_table.rb
harbr-0.1.73 vendor/bundle/ruby/3.2.0/gems/toml-rb-2.2.0/lib/toml-rb/inline_table.rb