Sha256: 671159ccea89a0dc4e5cc321f65d7f302a7a6bbaa09acea30aeaac7876a2baf2
Contents?: true
Size: 428 Bytes
Versions: 8
Compression:
Stored size: 428 Bytes
Contents
module RubyHackernews 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 end
Version data entries
8 entries across 8 versions & 1 rubygems