Class: Scraper

Inherits:
Object
  • Object
show all
Defined in:
lib/scraper.rb

Instance Method Summary collapse

Instance Method Details

#get_pageObject



9
10
11
12
# File 'lib/scraper.rb', line 9

def get_page
    doc = Nokogiri::HTML(open("https://zodiacal.herokuapp.com/api"))
    JSON.parse(doc)
end

#scrapeObject



3
4
5
6
7
8
# File 'lib/scraper.rb', line 3

def scrape
    zodiac_hashes = get_page
    zodiac_hashes.each do |z_hash|
        Zodiac.new(z_hash)
    end
end