module WrapIt::HTML::ClassMethods
{HTML} class methods
Public Instance Methods
html_class(*args)
click to toggle source
Adds default html classes, thats are automatically added when element created. @overload html_class
([html_class, …])
@param html_class [String, Symbol, Array<String, Symbol>] HTML class. Converted to `String`
@return [void]
# File lib/wrap_it/html.rb, line 131 def html_class(*args) (@html_class ||= HTMLClass.new) << args end
html_class_prefix(prefix = nil)
click to toggle source
Sets HTML
class prefix. It used in switchers and enums @param prefix [String] HTML
class prefix
@return [void]
# File lib/wrap_it/html.rb, line 140 def html_class_prefix(prefix = nil) return(get_derived(:@html_class_prefix) || '') if prefix.nil? prefix.is_a?(Symbol) && prefix = prefix.to_s prefix.is_a?(String) || fail(ArgumentError, 'prefix should be a String or Symbol') @html_class_prefix = prefix end