lib/matchers/json/json_path.rb
# if the path item contains an index (eg 'sample[3]') then the index will be returned
# if not, second return value will be nil [element,index]
if the path item contains an index  then the index will be returned
if not, second return value will be nil [element,index]
if the path item contains an index then the index will be returned if not second return value will be nil [ element index ]
def decompose_path_item(path_item)
        element, index = path_item.split('[')
        index = index[0..-2].to_i if index
        [element, index]
      end
def decompose_path_item ( path_item ) element , index = path_item . split ( '[' ) index = index [ 0 .. - 2 ] . to_i if index [ element , index ] end
if the path item contains an index (eg 'sample[3]') then the index will be returned
if not, second return value will be nil [element,index]
if the path item contains an index ( eg ' sample [ 3 ] ' ) then the index will be returned if not second return value will be nil [ element index ]
path_item
<not_specific>