Sha256: ca1e86b6f1f07bbd01ea6547239227a4d0bf8481fdc0fe3956a958f76d486139

Contents?: true

Size: 255 Bytes

Versions: 3

Compression:

Stored size: 255 Bytes

Contents

class UserInfoParser

  def initialize(user_element)
    @element = user_element
  end

  def parse
    user_name = @element.search("a")[0].inner_html
    user_page = @element.search("a")[0]['href']
    return UserInfo.new(user_name, user_page)
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ruby-hackernews-1.1.0 lib/ruby-hackernews/services/parsers/user_info_parser.rb
ruby-hackernews-1.0.1 lib/ruby-hackernews/services/parsers/user_info_parser.rb
ruby-hackernews-1.0.0 lib/HNAPI/services/parsers/user_info_parser.rb