Class: Widgetify::HTMLParser

Inherits:
Parser
  • Object
show all
Defined in:
lib/parser/html_parser.rb

Instance Method Summary collapse

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_parserObject



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