Class: AppleMusic::MusicVideo::Attributes

Inherits:
Object
  • Object
show all
Defined in:
lib/apple_music/music_video/attributes.rb

Overview

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(props = {}) ⇒ Attributes

Returns a new instance of Attributes.



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

def initialize(props = {})
  @album_name = props['albumName']
  @artist_name = props['artistName'] # required
  @artwork = Artwork.new(props['artwork']) # required
  @content_rating = props['contentRating']
  @duration_in_millis = props['durationInMillis']
  @editorial_notes = EditorialNotes.new(props['editorialNotes']) if props['editorialNotes']
  @genre_names = props['genreNames'] # required
  @isrc = props['isrc'] # required
  @name = props['name'] # required
  @play_params = PlayParameters.new(props['playParams']) if props['playParams']
  @previews = Array(props['previews']).map { |attrs| Preview.new(attrs) } # required
  @release_date = Date.parse(props['releaseDate']) # required
  @track_number = props['trackNumber']
  @url = props['url'] # required
  @video_sub_type = props['videoSubType']
  @has_hdr = props['hasHDR'] # required
  @has_4k = props['has4K'] # required
end

Instance Attribute Details

#album_nameObject (readonly)

Returns the value of attribute album_name.



7
8
9
# File 'lib/apple_music/music_video/attributes.rb', line 7

def album_name
  @album_name
end

#artist_nameObject (readonly)

Returns the value of attribute artist_name.



7
8
9
# File 'lib/apple_music/music_video/attributes.rb', line 7

def artist_name
  @artist_name
end

#artworkObject (readonly)

Returns the value of attribute artwork.



7
8
9
# File 'lib/apple_music/music_video/attributes.rb', line 7

def artwork
  @artwork
end

#content_ratingObject (readonly)

Returns the value of attribute content_rating.



7
8
9
# File 'lib/apple_music/music_video/attributes.rb', line 7

def content_rating
  @content_rating
end

#duration_in_millisObject (readonly)

Returns the value of attribute duration_in_millis.



7
8
9
# File 'lib/apple_music/music_video/attributes.rb', line 7

def duration_in_millis
  @duration_in_millis
end

#editorial_notesObject (readonly)

Returns the value of attribute editorial_notes.



7
8
9
# File 'lib/apple_music/music_video/attributes.rb', line 7

def editorial_notes
  @editorial_notes
end

#genre_namesObject (readonly)

Returns the value of attribute genre_names.



7
8
9
# File 'lib/apple_music/music_video/attributes.rb', line 7

def genre_names
  @genre_names
end

#has_4kObject (readonly)

Returns the value of attribute has_4k.



7
8
9
# File 'lib/apple_music/music_video/attributes.rb', line 7

def has_4k
  @has_4k
end

#has_hdrObject (readonly)

Returns the value of attribute has_hdr.



7
8
9
# File 'lib/apple_music/music_video/attributes.rb', line 7

def has_hdr
  @has_hdr
end

#isrcObject (readonly)

Returns the value of attribute isrc.



7
8
9
# File 'lib/apple_music/music_video/attributes.rb', line 7

def isrc
  @isrc
end

#nameObject (readonly)

Returns the value of attribute name.



7
8
9
# File 'lib/apple_music/music_video/attributes.rb', line 7

def name
  @name
end

#play_paramsObject (readonly)

Returns the value of attribute play_params.



7
8
9
# File 'lib/apple_music/music_video/attributes.rb', line 7

def play_params
  @play_params
end

#previewsObject (readonly)

Returns the value of attribute previews.



7
8
9
# File 'lib/apple_music/music_video/attributes.rb', line 7

def previews
  @previews
end

#release_dateObject (readonly)

Returns the value of attribute release_date.



7
8
9
# File 'lib/apple_music/music_video/attributes.rb', line 7

def release_date
  @release_date
end

#track_numberObject (readonly)

Returns the value of attribute track_number.



7
8
9
# File 'lib/apple_music/music_video/attributes.rb', line 7

def track_number
  @track_number
end

#urlObject (readonly)

Returns the value of attribute url.



7
8
9
# File 'lib/apple_music/music_video/attributes.rb', line 7

def url
  @url
end

#video_sub_typeObject (readonly)

Returns the value of attribute video_sub_type.



7
8
9
# File 'lib/apple_music/music_video/attributes.rb', line 7

def video_sub_type
  @video_sub_type
end

Instance Method Details

#has_4k?Boolean

Returns:

  • (Boolean)


35
36
37
# File 'lib/apple_music/music_video/attributes.rb', line 35

def has_4k?
  has_4k
end

#has_hdr?Boolean

Returns:

  • (Boolean)


31
32
33
# File 'lib/apple_music/music_video/attributes.rb', line 31

def has_hdr?
  has_hdr
end