Sha256: 5788e768b4679dde611100217eae1de9f5f9bf8e36190a4ecc9e9cc988286a59

Contents?: true

Size: 551 Bytes

Versions: 2

Compression:

Stored size: 551 Bytes

Contents

module Configurations
  module Maps
    class Data
      class Entry
        def initialize(value)
          @value = value
        end
      end

      def initialize(
        reader = Readers::Tolerant.new,
        writer = Writers::Default.new { |value|
          Entry.new(value)
        }
      )
        @map = {}
        @reader = reader
        @writer = writer
      end

      def nested?(path)
        @reader.read(@map, path)
      end

      def add_entry(path, value)
        @writer.write(@map, path, value)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
configurations-2.2.2 lib/configurations/maps/data.rb
configurations-2.2.1 lib/configurations/maps/data.rb