Class: KcrwApi::Track

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(track_hash) ⇒ Track

Returns a new instance of Track.



12
13
14
15
16
17
18
19
20
21
# File 'lib/kcrw_api/track.rb', line 12

def initialize(track_hash)
  @album_image = track_hash['albumImage']
  @album_image_large = track_hash['albumImageLarge']
  @album = track_hash['album']
  @artist = track_hash['artist']
  @label = track_hash['label']
  @title = track_hash['title']
  @year = track_hash['year']
  # @spotify_uri = spotify_uri
end

Instance Attribute Details

#albumObject (readonly)

Returns the value of attribute album.



5
6
7
# File 'lib/kcrw_api/track.rb', line 5

def album
  @album
end

#album_imageObject (readonly)

Returns the value of attribute album_image.



3
4
5
# File 'lib/kcrw_api/track.rb', line 3

def album_image
  @album_image
end

#album_image_largeObject (readonly)

Returns the value of attribute album_image_large.



4
5
6
# File 'lib/kcrw_api/track.rb', line 4

def album_image_large
  @album_image_large
end

#artistObject (readonly)

Returns the value of attribute artist.



6
7
8
# File 'lib/kcrw_api/track.rb', line 6

def artist
  @artist
end

#labelObject (readonly)

Returns the value of attribute label.



7
8
9
# File 'lib/kcrw_api/track.rb', line 7

def label
  @label
end

#titleObject (readonly)

attr_reader :spotify_uri



9
10
11
# File 'lib/kcrw_api/track.rb', line 9

def title
  @title
end

#yearObject (readonly)

Returns the value of attribute year.



10
11
12
# File 'lib/kcrw_api/track.rb', line 10

def year
  @year
end