class HTMLClassMerge::GroupRegistry

Included Modules

Defined in:

html_class_merge/group_registry.cr

Instance Method Summary

Instance methods inherited from module HTMLClassMerge::RegexIndex

regex_index(regex : Regex, n = 2, char = /[\w-]/) : String | Nil regex_index

Instance methods inherited from module HTMLClassMerge::Tokenize

tokenize(tokens : Enumerable(String)) : Array(String)
tokenize(tokens : String) : Array(String)
tokenize(*tokens : Tokenizable) : Array(String)
tokenize

Instance Method Detail

def clone #

Returns a copy of self with all instance variables cloned.


[View source]
def group_for?(token : String) : Symbol | Nil #

Returns the group of token, or nil


[View source]
def groups_replaced_by?(group : Symbol) : Set(Symbol) #

Returns the set of groups that group replaces, or nil if there are none


[View source]
def merge!(other : GroupRegistry) : self #

merge other into this registry


[View source]
def regex_matchers : Hash(String?, Hash(Regex, Symbol)) #

regex matchers are indexed by the first 2 characters of what they would match, to speed up lookup


[View source]
def register!(group : Symbol, matcher : String) : self #

Register a String matcher for group


[View source]
def register!(group : Symbol, matcher : Regex) : self #

Register a Regex matcher for group

Regexes are indexed by the first 2 characters of what they would match, to speed up lookup


[View source]
def register!(group : Symbol, matcher : Enumerable(String | Regex)) : self #

Register a collection of String or Regex matchers for group


[View source]
def register!(group : Symbol, replace : Symbol) : self #

Register a group's replacements


[View source]
def register!(group : Symbol, replace : Enumerable(Symbol)) : self #

Register a collection of replacements for group


[View source]
def register!(group : Symbol, *matchers : Matcher, replace : Symbol | Enumerable(Symbol)) : self #

Register matchers, and replacements for group


[View source]
def register!(group : Symbol, *matchers : Matcher) : self #

Register a splat of String or Regex matchers for group


[View source]
def replaces : Hash(Symbol, Set(Symbol)) #

[View source]
def string_matchers : Hash(String, Symbol) #

[View source]