Sha256: 9cd24677f8016da3cdcda5f290a743a067b56bf99cdfdca1d3ae73b01122ea8e
Contents?: true
Size: 379 Bytes
Versions: 8
Compression:
Stored size: 379 Bytes
Contents
class LinkInfoParser def initialize(link_element) @element = link_element end def parse link = @element.search("a")[0]['href'] title = @element.search("a")[0].inner_html site_element = @element.search("span") site = site_element.inner_html.sub("(","").sub(")","").strip if site_element.any? return LinkInfo.new(title, link, site) end end
Version data entries
8 entries across 8 versions & 1 rubygems