Module: Clsx::Helper
- Defined in:
- lib/clsx/helper.rb
Overview
:nodoc:
Instance Method Summary collapse
-
#clsx(*args) ⇒ String
(also: #cn)
The clsx function can take any number of arguments, each of which can be an Hash, Array, Boolean, String, or Symbol.
Instance Method Details
#clsx(*args) ⇒ String Also known as: cn
The clsx function can take any number of arguments, each of which can be an Hash, Array, Boolean, String, or Symbol.
Important: Any falsy values are discarded! Standalone Boolean values are discarded as well.
28 29 30 31 32 |
# File 'lib/clsx/helper.rb', line 28 def clsx(*args) result = clsx_args_processor(*args) result.uniq! result.join(' ').presence end |