Module: DevSuite::Utils::Data::PathAccess

Included in:
DevSuite::Utils::Data
Defined in:
lib/dev_suite/utils/data/path_access.rb,
lib/dev_suite/utils/data/path_access/errors.rb,
lib/dev_suite/utils/data/path_access/key_handler.rb,
lib/dev_suite/utils/data/path_access/path_parser.rb,
lib/dev_suite/utils/data/path_access/path_accessor.rb,
lib/dev_suite/utils/data/path_access/data_traverser.rb

Defined Under Namespace

Modules: DataTraverser, KeyHandler, PathAccessor, PathParser Classes: DataStructureError, InvalidPathError

Instance Method Summary collapse

Instance Method Details

#delete_key_by_path(data, path) ⇒ Object

Delete a key from a nested structure using a path



20
21
22
# File 'lib/dev_suite/utils/data/path_access.rb', line 20

def delete_key_by_path(data, path)
  PathAccessor.delete(data, path)
end

#get_value_by_path(data, path) ⇒ Object

Fetch value from a nested structure using a path



10
11
12
# File 'lib/dev_suite/utils/data/path_access.rb', line 10

def get_value_by_path(data, path)
  PathAccessor.get(data, path)
end

#set_value_by_path(data, path, value) ⇒ Object

Set value in a nested structure using a path



15
16
17
# File 'lib/dev_suite/utils/data/path_access.rb', line 15

def set_value_by_path(data, path, value)
  PathAccessor.set(data, path, value)
end