Class: Bnm::Init

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

Constant Summary collapse

@@url =
"http://pitchfork.com/reviews/best/albums/"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeInit

Returns a new instance of Init.



7
8
9
# File 'lib/bnm/init.rb', line 7

def initialize
  @artists = Array.new
end

Instance Attribute Details

#artistsObject

Returns the value of attribute artists.



4
5
6
# File 'lib/bnm/init.rb', line 4

def artists
  @artists
end

Instance Method Details

#callObject



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/bnm/init.rb', line 11

def call

  # INITIATES SPINNER
  thr = Thread.new do
    while true
      Bnm::Spinner.loading
    end
  end

  # SCRAPING URIS AND ARTISTS
  @artists = Bnm::Scrape.init_scrape(@@url)
  Bnm::Scrape.deep_scrape(@artists)
  Bnm::API.itunes(@artists)

  # KILLS SPINNER AND CLEARS FROM SCREEN
  Thread.kill(thr)
  print "\r"

  # PRINTS OUT DYNAMIC CLI
  Bnm::CLI.launch(@artists)
end