Sha256: 0ae0b7fb8bc03bdd696957ac70e26fc6cca0eae06677449bf19f6f130d09a965
Contents?: true
Size: 984 Bytes
Versions: 19
Compression:
Stored size: 984 Bytes
Contents
# frozen_string_literal: true # StringActions Module module KepplerFrontend module Concerns module StringActions extend ActiveSupport::Concern private def not_special_chars chars = ('a'..'z').to_a << '_' chars << ':' end def without_special_characters self.name.gsub!(' ', '_') special_characters.each { |sc| self.name.gsub!(sc, '') } end def has_a_special_characters(name) chars = name.split('') chars.each do |c| if special_characters.include?(c) return true else return false end end end def special_characters [ '/', '.', '@', '"', "'", '%', '&', '$', '?', '¿', '/', '=', ')', '(', '#', '{', '}', ',', ';', ':', '[', ']', '^', '`', '¨', '~', '+', '-', '*', '¡', '!', '|', '¬', '°', '<', '>', '·', '½' ] end end end end
Version data entries
19 entries across 19 versions & 1 rubygems