Class: Hpricot::Comment

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

Instance Method Summary collapse

Instance Method Details

#removeObject



132
133
134
# File 'lib/hpricot_scrub/hpricot_scrub.rb', line 132

def remove
  parent.children.delete(self)
end

#scrub(config = nil) ⇒ Object

Scrubs this comment according to the given config If the config key :default_comment_rule is true, the comment is kept. Otherwise it’s removed.



140
141
142
143
144
145
# File 'lib/hpricot_scrub/hpricot_scrub.rb', line 140

def scrub(config = nil)
  config = Scrub::normalize_config(config)
  rule = config[:default_comment_rule]
  remove unless rule
  return true
end