Module: Fortitude::Widget::Tags::ClassMethods

Defined in:
lib/fortitude/widget/tags.rb

Instance Method Summary collapse

Instance Method Details

#rebuild_tag_methods!(why, which_tags_in = nil, klass = self) ⇒ Object

INTERNAL USE ONLY


40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/fortitude/widget/tags.rb', line 40

def rebuild_tag_methods!(why, which_tags_in = nil, klass = self)
  rebuilding(:tag_methods, why, klass) do
    all_tags = tags.values

    which_tags = Array(which_tags_in || all_tags)
    which_tags.each do |tag_object|
      tag_object.define_method_on!(tags_module,
        :enable_formatting => self.format_output,
        :record_emitting_tag => self._fortitude_record_emitting_tag?,
        :enforce_attribute_rules => self.enforce_attribute_rules,
        :enforce_id_uniqueness => self.enforce_id_uniqueness,
        :close_void_tags => self.close_void_tags,
        :allows_bare_attributes => self.doctype.allows_bare_attributes?)
    end

    direct_subclasses.each { |s| s.rebuild_tag_methods!(why, which_tags_in, klass) }
  end
end