class HTMLClassMerge::GroupRegistry
- HTMLClassMerge::GroupRegistry
- Reference
- Object
Included Modules
Defined in:
html_class_merge/group_registry.crInstance Method Summary
-
#clone
Returns a copy of
selfwith all instance variables cloned. -
#group_for?(token : String) : Symbol | Nil
Returns the group of token, or nil
-
#groups_replaced_by?(group : Symbol) : Set(Symbol)
Returns the set of groups that group replaces, or nil if there are none
-
#merge!(other : GroupRegistry) : self
merge other into this registry
-
#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
-
#register!(group : Symbol, matcher : String) : self
Register a String matcher for group
-
#register!(group : Symbol, matcher : Regex) : self
Register a Regex matcher for group
-
#register!(group : Symbol, matcher : Enumerable(String | Regex)) : self
Register a collection of String or Regex matchers for group
-
#register!(group : Symbol, replace : Symbol) : self
Register a group's replacements
-
#register!(group : Symbol, replace : Enumerable(Symbol)) : self
Register a collection of replacements for group
-
#register!(group : Symbol, *matchers : Matcher, replace : Symbol | Enumerable(Symbol)) : self
Register matchers, and replacements for group
-
#register!(group : Symbol, *matchers : Matcher) : self
Register a splat of String or Regex matchers for group
- #replaces : Hash(Symbol, Set(Symbol))
- #string_matchers : Hash(String, Symbol)
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
Returns the set of groups that group replaces, or nil if there are none
regex matchers are indexed by the first 2 characters of what they would match, to speed up lookup
Register a Regex matcher for group
Regexes are indexed by the first 2 characters of what they would match, to speed up lookup
Register a collection of String or Regex matchers for group
Register a collection of replacements for group
Register matchers, and replacements for group
Register a splat of String or Regex matchers for group