Class: Decidim::IframeDisabler
- Inherits:
-
Object
- Object
- Decidim::IframeDisabler
- Defined in:
- app/services/decidim/iframe_disabler.rb
Instance Method Summary collapse
-
#initialize(text, _options = {}) ⇒ IframeDisabler
constructor
A new instance of IframeDisabler.
- #perform ⇒ Object
Constructor Details
#initialize(text, _options = {}) ⇒ IframeDisabler
Returns a new instance of IframeDisabler.
5 6 7 |
# File 'app/services/decidim/iframe_disabler.rb', line 5 def initialize(text, = {}) @text = text end |
Instance Method Details
#perform ⇒ Object
9 10 11 12 13 |
# File 'app/services/decidim/iframe_disabler.rb', line 9 def perform @document = Nokogiri::HTML::DocumentFragment.parse(@text) disable_iframes(@document) document.to_html end |