Sha256: 4ec2d39b283eb59ccf83e40c6606d4034c0c35daead044c1fa013638b4107ad5

Contents?: true

Size: 657 Bytes

Versions: 2

Compression:

Stored size: 657 Bytes

Contents

# frozen_string_literal: true

module DevSuite
  module Utils
    module Data
      module PathAccess
        require_relative "path_access/path_accessor"

        # Fetch value from a nested structure using a path
        def get_value_by_path(data, path)
          PathAccessor.get(data, path)
        end

        # Set value in a nested structure using a path
        def set_value_by_path(data, path, value)
          PathAccessor.set(data, path, value)
        end

        # Delete a key from a nested structure using a path
        def delete_key_by_path(data, path)
          PathAccessor.delete(data, path)
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
dev_suite-0.2.13 lib/dev_suite/utils/data/path_access.rb
dev_suite-0.2.12 lib/dev_suite/utils/data/path_access.rb