Class: Undress::Document

Inherits:
Object show all
Defined in:
lib/undress.rb

Overview

:nodoc:

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(html, options) ⇒ Document

Returns a new instance of Document.



26
27
28
29
30
# File 'lib/undress.rb', line 26

def initialize(html, options)
  @doc = Hpricot(html, options)
  xhtmlize!
  cleanup_indentation
end

Class Method Details

.add_markup(name, grammar) ⇒ Object



32
33
34
35
36
# File 'lib/undress.rb', line 32

def self.add_markup(name, grammar)
  define_method "to_#{name}" do
    grammar.process!(@doc)
  end
end