method
extended
v2.1.0 -
Show latest stable
- Class:
ActionView::Helpers::SanitizeHelper::ClassMethods
extended(base)public
No documentation available.
# File actionpack/lib/action_view/helpers/sanitize_helper.rb, line 99
def self.extended(base)
class << base
attr_writer :full_sanitizer, :link_sanitizer, :white_list_sanitizer
# we want these to be class methods on ActionView::Base, they'll get mattr_readers for these below.
helper_def = [:sanitized_protocol_separator, :sanitized_uri_attributes, :sanitized_bad_tags, :sanitized_allowed_tags,
:sanitized_allowed_attributes, :sanitized_allowed_css_properties, :sanitized_allowed_css_keywords,
:sanitized_shorthand_css_properties, :sanitized_allowed_protocols, :sanitized_protocol_separator=].collect! do |prop|
prop = prop.to_s
"def #{prop}(#{:value if prop =~ /=$/}) white_list_sanitizer.#{prop.sub /sanitized_/, ''} #{:value if prop =~ /=$/} end"
end.join("\n")
eval helper_def
end
end