Sha256: 4bd6279b223443d784396b8a09d5c1065cb18204ec56f1a55209b77a175d4892
Contents?: true
Size: 407 Bytes
Versions: 8
Compression:
Stored size: 407 Bytes
Contents
# frozen_string_literal: true module EncodedId module Rails class SluggedIdParser def initialize(slugged_id, separator: "--") if separator && slugged_id.include?(separator) parts = slugged_id.split(separator) @slug = parts.first @id = parts.last else @id = slugged_id end end attr_reader :slug, :id end end end
Version data entries
8 entries across 8 versions & 1 rubygems