class HTMLClass::Dictionary

Overview

A dictionary of HTML classes, where keys are symbols or sets of 2 or more symbols, and values are Strings. Contains a reference to a merge strategy, which is used when a key already exists, and the #add OnCollision strategy is set to :merge.

Defined in:

html_class/dictionary.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(dict : Hash(Set(Symbol) | Symbol, String) = Hash(Symbol | Set(Symbol), String).new, merge : HTMLClassMerge::Merge = HTMLClass.default_merge) #

[View source]

Instance Method Detail

def [](*args, **options) #

[View source]
def [](*args, **options, &) #

[View source]
def []?(*args, **options) #

[View source]
def []?(*args, **options, &) #

[View source]
def add(key : Symbol | Enumerable(Symbol), html_class : String, on_collision : OnCollision = :merge) : self #

[View source]
def add(key, existing_key : Symbol | Enumerable(Symbol), on_collision : OnCollision = :merge) : self #

[View source]
def add(dictionary : Dictionary, on_collision : OnCollision = :merge) : self #

[View source]
def clone(dict = @dict.dup) #

[View source]
def to_h #

[View source]