Class: Bandcamp::Track

Inherits:
Object
  • Object
show all
Includes:
Associated, Methodical
Defined in:
lib/bandcamp/track.rb

Instance Method Summary collapse

Constructor Details

#initialize(attrs) ⇒ Track

Returns a new instance of Track.



12
13
14
# File 'lib/bandcamp/track.rb', line 12

def initialize attrs
  to_methods attrs
end

Instance Method Details

#albumObject



28
29
30
# File 'lib/bandcamp/track.rb', line 28

def album
  retrieve_associated :album
end

#bandObject



24
25
26
# File 'lib/bandcamp/track.rb', line 24

def band
  retrieve_associated :band
end

#free?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/bandcamp/track.rb', line 20

def free?
  downloadable == 1 ? true : false
end

#paid?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/bandcamp/track.rb', line 16

def paid?
  downloadable == 2 ? true : false
end