Class: Widgetify::HTMLParser
- Defined in:
- lib/parser/html_parser.rb
Instance Method Summary collapse
- #html_parser ⇒ Object
-
#initialize(html_doc) ⇒ HTMLParser
constructor
A new instance of HTMLParser.
Constructor Details
#initialize(html_doc) ⇒ HTMLParser
Returns a new instance of HTMLParser.
12 13 14 15 16 |
# File 'lib/parser/html_parser.rb', line 12 def initialize(html_doc) super(html_doc) @html_doc = html_doc html_parser end |
Instance Method Details
#html_parser ⇒ Object
18 19 20 21 22 23 |
# File 'lib/parser/html_parser.rb', line 18 def html_parser self['title'] = @html_doc.xpath('//title').text self['canonical_url'] = canonical_url self['description'] = description self['images'] = images end |