Class: BlueConductor::BandManager

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(band, song) ⇒ BandManager

Returns a new instance of BandManager.



6
7
8
9
10
11
# File 'lib/blue_conductor/band_manager.rb', line 6

def initialize(band, song)
  @band = band
  @song = song
  @album = ''
  @data = ''
end

Instance Attribute Details

#albumObject (readonly)

Returns the value of attribute album.



3
4
5
# File 'lib/blue_conductor/band_manager.rb', line 3

def album
  @album
end

#bandObject (readonly)

Returns the value of attribute band.



3
4
5
# File 'lib/blue_conductor/band_manager.rb', line 3

def band
  @band
end

#dataObject (readonly)

Returns the value of attribute data.



3
4
5
# File 'lib/blue_conductor/band_manager.rb', line 3

def data
  @data
end

#parserObject

Returns the value of attribute parser.



4
5
6
# File 'lib/blue_conductor/band_manager.rb', line 4

def parser
  @parser
end

#requestObject

Returns the value of attribute request.



4
5
6
# File 'lib/blue_conductor/band_manager.rb', line 4

def request
  @request
end

#songObject (readonly)

Returns the value of attribute song.



3
4
5
# File 'lib/blue_conductor/band_manager.rb', line 3

def song
  @song
end

#url_generatorObject

Returns the value of attribute url_generator.



4
5
6
# File 'lib/blue_conductor/band_manager.rb', line 4

def url_generator
  @url_generator
end

Instance Method Details

#song!Object



13
14
15
16
17
18
19
20
21
# File 'lib/blue_conductor/band_manager.rb', line 13

def song!
  url   = url_generator.generate(self)
  html  = request.fetch(url)

  @data = parser.data(html)
  @album = parser.album(html)

  BlueConductor::Song.new(self)
end