Sha256: a7969406a7fa6a65cedf7f21046a7c54e75d32a4b2725282dd009e357753eece
Contents?: true
Size: 749 Bytes
Versions: 104
Compression:
Stored size: 749 Bytes
Contents
# frozen_string_literal: true require 'eac_ruby_utils/core_ext' module Avm module Instances module Ids ID_PARTS_SEPARATOR = '_' ID_PATTERN = /\A([a-z0-9]+(?:\-[a-z0-9]+)*)_(.+)\z/.freeze ID_PARSER = ID_PATTERN.to_parser do |m| ::Struct.new(:application_id, :instance_suffix).new(m[1], m[2]) end class << self # @param application_id [String] # @param instance_suffix [String] # @return [String] def build(application_id, instance_suffix) [application_id, instance_suffix].join(ID_PARTS_SEPARATOR) end # @param id [String] # @return [String] def parse!(id) ID_PARSER.parse!(id) end end end end end
Version data entries
104 entries across 104 versions & 2 rubygems