Sha256: 062a696150bf757fff563c774ec54748bdab75f3bf87f51251aa3c31e4fb467b
Contents?: true
Size: 757 Bytes
Versions: 11
Compression:
Stored size: 757 Bytes
Contents
# frozen_string_literal: true module UiBibz::Utils # Utils methods can be used outside of Ui Bibz class Screwdriver include Singleton class << self def join_classes(*classes) klasses = Array(classes).flatten.filter_map(&:to_s).uniq.compact_blank klasses.empty? ? nil : klasses end def exclude_classes(html_classes, *classes) klasses = (html_classes || []).flatten.map(&:to_s).reject { |klass_name| Array(classes).flatten.include?(klass_name.to_s) || klass_name.blank? } klasses.empty? ? nil : klasses end def uniq_word_in_string(str) str.split(/\s/).uniq end def tapped?(block) block.present? && block.parameters.present? end end end end
Version data entries
11 entries across 11 versions & 1 rubygems