module Rudash::PathResolver

Public Class Methods

resolve(path) click to toggle source
# File lib/utils/path_resolver.rb, line 11
def self.resolve(path)
  normalized_path = path

  normalized_path = normalized_path.join('.') if normalized_path.is_a?(Array)

  filter_not_empty = ->(value) {
    value != ''
  }

  R_.filter(
    normalized_path.split(/[.\[\]]/),
    filter_not_empty
  )
end