Class: Refinery::Pages::CustomScrubber
- Inherits:
-
Rails::Html::PermitScrubber
- Object
- Rails::Html::PermitScrubber
- Refinery::Pages::CustomScrubber
- Defined in:
- app/presenters/refinery/pages/section_presenter.rb
Instance Method Summary collapse
- #allowed_node?(node) ⇒ Boolean
-
#initialize(tags, attributes) ⇒ CustomScrubber
constructor
A new instance of CustomScrubber.
- #scrub_attribute?(name) ⇒ Boolean
- #skip_node?(node) ⇒ Boolean
Constructor Details
#initialize(tags, attributes) ⇒ CustomScrubber
Returns a new instance of CustomScrubber.
88 89 90 91 92 |
# File 'app/presenters/refinery/pages/section_presenter.rb', line 88 def initialize(, attributes) @direction = :bottom_up @tags = @attributes = attributes end |
Instance Method Details
#allowed_node?(node) ⇒ Boolean
94 95 96 |
# File 'app/presenters/refinery/pages/section_presenter.rb', line 94 def allowed_node?(node) .include?(node.name) end |
#scrub_attribute?(name) ⇒ Boolean
102 103 104 |
# File 'app/presenters/refinery/pages/section_presenter.rb', line 102 def scrub_attribute?(name) attributes.exclude?(name) && name !~ /\Adata-[\w-]+\z/ end |
#skip_node?(node) ⇒ Boolean
98 99 100 |
# File 'app/presenters/refinery/pages/section_presenter.rb', line 98 def skip_node?(node) node.text? end |