You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

13 lines
421 B

module QuestionsCrafter
class Utils
class << self
# Returns a dasherized string that can be used as a prefix for HTML class names. It removes the Questions suffix.
# Example: "SignUpQuestions" -> "sign-up"
def html_class_name_prefix(questions:)
name = questions.class.name
name = name.demodulize.gsub(/Questions$/, "").underscore.dasherize
name
end
end
end
end