Sha256: 5b378cde6d3530adf34312ff306d15d2e29e297b2c0346970ae77098accd6bb9
Contents?: true
Size: 356 Bytes
Versions: 12
Compression:
Stored size: 356 Bytes
Contents
module Lookbook class PositionPrefixParser < Service POSITION_PREFIX_REGEX = /^(\d+?)[-_]/ attr_reader :input def initialize(input) @input = String(input) end def call matches = input.match(POSITION_PREFIX_REGEX) matches ? [matches[1].to_i, input.gsub(POSITION_PREFIX_REGEX, "")] : [nil, input] end end end
Version data entries
12 entries across 12 versions & 1 rubygems