Sha256: 5ae2b8dec62a687e7512e320e00ef042e21c64ae7a3bf7d53b5fbfcc579392ea
Contents?: true
Size: 454 Bytes
Versions: 6
Compression:
Stored size: 454 Bytes
Contents
module RubyHackernews class CommentsInfoParser def initialize(comments_element) @element = comments_element.search("a")[1] end def parse comments_info = nil if @element && @element['href'] =~ /id/ comments = @element.inner_html.split[0].to_i comments_page = @element['href'] comments_info = CommentsInfo.new(comments, comments_page) end return comments_info end end end
Version data entries
6 entries across 6 versions & 1 rubygems