Sha256: 5cd6f566afdeec9982765d394638c83fd48df7e6bc08373ae5e28e337d4bc60c

Contents?: true

Size: 321 Bytes

Versions: 1

Compression:

Stored size: 321 Bytes

Contents

module StrawberryCough

  class PathParser

    PARAM_PATTERN = /:([\w_\d]+)\(*/
    SPLIT_ME = "{}{}}{}{}}{}"

    def self.parse_params(path)
      path.scan(PARAM_PATTERN).flatten
    end

    def self.parse_anchors(path)
      path.gsub(/\(.*\)/, '').gsub(PARAM_PATTERN, SPLIT_ME).split(SPLIT_ME)
    end

  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
strawberry_cough-0.1.0 lib/strawberry_cough/path_parser.rb