Sha256: 75059205d5585bd0b7ba8f5561211ae9b39c0db221f6571efef021d0c97c6970

Contents?: true

Size: 522 Bytes

Versions: 1

Compression:

Stored size: 522 Bytes

Contents

module Hckr
  class Runner

    def initialize type
      @type = type
    end

    def run!
      greeting
      links = Hckr::Scraper.new(@type).scrape!
      links.each do |hash|
        print_link_info(hash)
      end
    end

    private

    def greeting
      greeting = "Currently, top links on HN. (Cmd/Ctrl + double click on a link to open it in browser)"
      puts greeting
      puts "=" * greeting.length
    end

    def print_link_info(link)
      puts "#{link[:name]} - #{link[:href]}"
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
hckr-0.0.1 lib/hckr/runner.rb