Class: Bulbasaur::RemoveTags
- Inherits:
-
Object
- Object
- Bulbasaur::RemoveTags
- Defined in:
- lib/bulbasaur/removals/remove_tags.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(html, banned_tags) ⇒ RemoveTags
constructor
A new instance of RemoveTags.
Constructor Details
#initialize(html, banned_tags) ⇒ RemoveTags
Returns a new instance of RemoveTags.
3 4 5 6 |
# File 'lib/bulbasaur/removals/remove_tags.rb', line 3 def initialize(html, ) @html = html = end |
Instance Method Details
#call ⇒ Object
8 9 10 11 12 |
# File 'lib/bulbasaur/removals/remove_tags.rb', line 8 def call parsed_html = Nokogiri::HTML::DocumentFragment.parse @html .each { |tag| parsed_html.css(tag).remove } parsed_html.to_s end |