Class: Thymeleaf::Dialects

Inherits:
Object
  • Object
show all
Defined in:
lib/thymeleaf/dialects.rb

Instance Method Summary collapse

Constructor Details

#initializeDialects

Returns a new instance of Dialects.



6
7
8
# File 'lib/thymeleaf/dialects.rb', line 6

def initialize
  clear_dialects
end

Instance Method Details

#add_dialect(*args) ⇒ Object



10
11
12
13
14
15
16
17
18
# File 'lib/thymeleaf/dialects.rb', line 10

def add_dialect(*args)
  key, dialect_class = * expand_key_dialect(*args)

  dialect = dialect_class.new

  registered_dialects[key] = dialect
  registered_attr_processors[key] = dialect_processors(dialect)
  registered_tag_processors[key] = dialect_tag_processors(dialect)
end

#clear_dialectsObject



20
21
22
23
24
# File 'lib/thymeleaf/dialects.rb', line 20

def clear_dialects
  self.registered_dialects        = {}
  self.registered_attr_processors = {}
  self.registered_tag_processors  = {}
end

#find_attr_processor(key) ⇒ Object



26
27
28
# File 'lib/thymeleaf/dialects.rb', line 26

def find_attr_processor(key)
  find_processor key, dialect_attr_matchers, registered_attr_processors
end

#find_tag_processor(key) ⇒ Object



30
31
32
# File 'lib/thymeleaf/dialects.rb', line 30

def find_tag_processor(key)
  find_processor key, dialect_tag_matchers, registered_tag_processors
end