Class: CW::RSSClean

Inherits:
Object
  • Object
show all
Defined in:
lib/cw/rss_clean.rb

Instance Method Summary collapse

Constructor Details

#initialize(html_fragment) ⇒ RSSClean

Returns a new instance of RSSClean.



5
6
7
# File 'lib/cw/rss_clean.rb', line 5

def initialize(html_fragment)
  @html_fragment = html_fragment
end

Instance Method Details

#scrub(options = {}) ⇒ Object



9
10
11
12
13
# File 'lib/cw/rss_clean.rb', line 9

def scrub(options = {})
  blacklisted_tags =  + options.fetch(:blacklist, [])

  sanitize(Oga.parse_html(html_fragment).children, blacklisted_tags)
end