Sha256: 42f991d623f5581deee81063811c1ef04569b51cab109d80fb64009c935bd00b
Contents?: true
Size: 323 Bytes
Versions: 17
Compression:
Stored size: 323 Bytes
Contents
module Locator::Index INDEX_REGEX = /(.*)?\[(.*)\]\s*$/ module_function def execute(locator) return [nil, nil] if locator.nil? matches = INDEX_REGEX.match(locator) return [locator, nil] unless matches text = matches.captures[0] index = matches.captures[1].to_i [text, index] end end
Version data entries
17 entries across 17 versions & 1 rubygems