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