Sha256: c674f9aee96976ddfd927e4176c6ffd50d59e7064f89902cab239be1fccdfa62
Contents?: true
Size: 430 Bytes
Versions: 3
Compression:
Stored size: 430 Bytes
Contents
class VotingInfoParser def initialize(voting_element, score_element) @voting_element = voting_element @score_element = score_element end def parse upvote = @voting_element[0]['href'] if @voting_element[0] downvote = @voting_element[1]['href'] if @voting_element[1] score = @score_element.search("span")[0].inner_html.split[0].to_i return VotingInfo.new(score, upvote, downvote) end end
Version data entries
3 entries across 3 versions & 1 rubygems