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.72 vendor/bundle/ruby/3.2.0/gems/toml-rb-2.2.0/lib/toml-rb/inline_table.rb
harbr-0.1.71 vendor/bundle/ruby/3.2.0/gems/toml-rb-2.2.0/lib/toml-rb/inline_table.rb
harbr-0.1.70 vendor/bundle/ruby/3.2.0/gems/toml-rb-2.2.0/lib/toml-rb/inline_table.rb
harbr-0.1.69 vendor/bundle/ruby/3.2.0/gems/toml-rb-2.2.0/lib/toml-rb/inline_table.rb
harbr-0.1.68 vendor/bundle/ruby/3.2.0/gems/toml-rb-2.2.0/lib/toml-rb/inline_table.rb
harbr-0.1.67 vendor/bundle/ruby/3.2.0/gems/toml-rb-2.2.0/lib/toml-rb/inline_table.rb
harbr-0.1.66 vendor/bundle/ruby/3.2.0/gems/toml-rb-2.2.0/lib/toml-rb/inline_table.rb
harbr-0.1.65 vendor/bundle/ruby/3.2.0/gems/toml-rb-2.2.0/lib/toml-rb/inline_table.rb
harbr-0.1.64 vendor/bundle/ruby/3.2.0/gems/toml-rb-2.2.0/lib/toml-rb/inline_table.rb
harbr-0.1.63 vendor/bundle/ruby/3.2.0/gems/toml-rb-2.2.0/lib/toml-rb/inline_table.rb
harbr-0.1.62 vendor/bundle/ruby/3.2.0/gems/toml-rb-2.2.0/lib/toml-rb/inline_table.rb
harbr-0.1.61 vendor/bundle/ruby/3.2.0/gems/toml-rb-2.2.0/lib/toml-rb/inline_table.rb
harbr-0.1.60 vendor/bundle/ruby/3.2.0/gems/toml-rb-2.2.0/lib/toml-rb/inline_table.rb
harbr-0.1.59 vendor/bundle/ruby/3.2.0/gems/toml-rb-2.2.0/lib/toml-rb/inline_table.rb
harbr-0.1.58 vendor/bundle/ruby/3.2.0/gems/toml-rb-2.2.0/lib/toml-rb/inline_table.rb
harbr-0.1.57 vendor/bundle/ruby/3.2.0/gems/toml-rb-2.2.0/lib/toml-rb/inline_table.rb
harbr-0.1.56 vendor/bundle/ruby/3.2.0/gems/toml-rb-2.2.0/lib/toml-rb/inline_table.rb
harbr-0.1.55 vendor/bundle/ruby/3.2.0/gems/toml-rb-2.2.0/lib/toml-rb/inline_table.rb
harbr-0.1.54 vendor/bundle/ruby/3.2.0/gems/toml-rb-2.2.0/lib/toml-rb/inline_table.rb
harbr-0.1.53 vendor/bundle/ruby/3.2.0/gems/toml-rb-2.2.0/lib/toml-rb/inline_table.rb