Sha256: 668835f01ed216b2bb245c5111f98a6ed6d883e47a6152fa46a81de6e976f296
Contents?: true
Size: 397 Bytes
Versions: 13
Compression:
Stored size: 397 Bytes
Contents
# frozen_string_literal: true module ServiceSkeleton module ServiceName def service_name service_name_from_class(self) end private def service_name_from_class(klass) klass.to_s .gsub("::", "_") .gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2') .gsub(/([a-z\d])([A-Z])/, '\1_\2') .downcase .gsub(/[^a-zA-Z0-9_]/, "_") end end end
Version data entries
13 entries across 13 versions & 1 rubygems