Class: AppleMusic::Album::Attributes
- Inherits:
-
Object
- Object
- AppleMusic::Album::Attributes
- Defined in:
- lib/apple_music/album/attributes.rb
Overview
Instance Attribute Summary collapse
-
#album_name ⇒ Object
readonly
Returns the value of attribute album_name.
-
#artist_name ⇒ Object
readonly
Returns the value of attribute artist_name.
-
#artwork ⇒ Object
readonly
Returns the value of attribute artwork.
-
#content_rating ⇒ Object
readonly
Returns the value of attribute content_rating.
-
#copyright ⇒ Object
readonly
Returns the value of attribute copyright.
-
#editorial_notes ⇒ Object
readonly
Returns the value of attribute editorial_notes.
-
#genre_names ⇒ Object
readonly
Returns the value of attribute genre_names.
-
#is_complete ⇒ Object
readonly
Returns the value of attribute is_complete.
-
#is_mastered_for_itunes ⇒ Object
readonly
Returns the value of attribute is_mastered_for_itunes.
-
#is_single ⇒ Object
readonly
Returns the value of attribute is_single.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#play_params ⇒ Object
readonly
Returns the value of attribute play_params.
-
#record_label ⇒ Object
readonly
Returns the value of attribute record_label.
-
#release_date ⇒ Object
readonly
Returns the value of attribute release_date.
-
#track_count ⇒ Object
readonly
Returns the value of attribute track_count.
-
#upc ⇒ Object
readonly
Returns the value of attribute upc.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
- #complete? ⇒ Boolean
-
#initialize(props = {}) ⇒ Attributes
constructor
A new instance of Attributes.
- #mastered_for_itunes? ⇒ Boolean
- #single? ⇒ Boolean
Constructor Details
#initialize(props = {}) ⇒ Attributes
Returns a new instance of Attributes.
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/apple_music/album/attributes.rb', line 12 def initialize(props = {}) @album_name = props['albumName'] # required @artist_name = props['artistName'] # required @artwork = Artwork.new(props['artwork']) if props['artwork'] @content_rating = props['contentRating'] @copyright = props['copyright'] @editorial_notes = EditorialNotes.new(props['editorialNotes']) if props['editorialNotes'] @genre_names = props['genreNames'] # required @is_complete = props['isComplete'] # required @is_single = props['isSingle'] # required @name = props['name'] # required @play_params = PlayParameters.new(props['playParams']) if props['playParams'] @record_label = props['recordLabel'] # required @release_date = begin # required Date.parse(props['releaseDate']) rescue ArgumentError Date.parse("#{props['releaseDate']}/01/01") end @track_count = props['trackCount'] # required @url = props['url'] # required @is_mastered_for_itunes = props['isMasteredForItunes'] # required @upc = props['upc'] end |
Instance Attribute Details
#album_name ⇒ Object (readonly)
Returns the value of attribute album_name.
7 8 9 |
# File 'lib/apple_music/album/attributes.rb', line 7 def album_name @album_name end |
#artist_name ⇒ Object (readonly)
Returns the value of attribute artist_name.
7 8 9 |
# File 'lib/apple_music/album/attributes.rb', line 7 def artist_name @artist_name end |
#artwork ⇒ Object (readonly)
Returns the value of attribute artwork.
7 8 9 |
# File 'lib/apple_music/album/attributes.rb', line 7 def artwork @artwork end |
#content_rating ⇒ Object (readonly)
Returns the value of attribute content_rating.
7 8 9 |
# File 'lib/apple_music/album/attributes.rb', line 7 def @content_rating end |
#copyright ⇒ Object (readonly)
Returns the value of attribute copyright.
7 8 9 |
# File 'lib/apple_music/album/attributes.rb', line 7 def copyright @copyright end |
#editorial_notes ⇒ Object (readonly)
Returns the value of attribute editorial_notes.
7 8 9 |
# File 'lib/apple_music/album/attributes.rb', line 7 def editorial_notes @editorial_notes end |
#genre_names ⇒ Object (readonly)
Returns the value of attribute genre_names.
7 8 9 |
# File 'lib/apple_music/album/attributes.rb', line 7 def genre_names @genre_names end |
#is_complete ⇒ Object (readonly)
Returns the value of attribute is_complete.
7 8 9 |
# File 'lib/apple_music/album/attributes.rb', line 7 def is_complete @is_complete end |
#is_mastered_for_itunes ⇒ Object (readonly)
Returns the value of attribute is_mastered_for_itunes.
7 8 9 |
# File 'lib/apple_music/album/attributes.rb', line 7 def is_mastered_for_itunes @is_mastered_for_itunes end |
#is_single ⇒ Object (readonly)
Returns the value of attribute is_single.
7 8 9 |
# File 'lib/apple_music/album/attributes.rb', line 7 def is_single @is_single end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/apple_music/album/attributes.rb', line 7 def name @name end |
#play_params ⇒ Object (readonly)
Returns the value of attribute play_params.
7 8 9 |
# File 'lib/apple_music/album/attributes.rb', line 7 def play_params @play_params end |
#record_label ⇒ Object (readonly)
Returns the value of attribute record_label.
7 8 9 |
# File 'lib/apple_music/album/attributes.rb', line 7 def record_label @record_label end |
#release_date ⇒ Object (readonly)
Returns the value of attribute release_date.
7 8 9 |
# File 'lib/apple_music/album/attributes.rb', line 7 def release_date @release_date end |
#track_count ⇒ Object (readonly)
Returns the value of attribute track_count.
7 8 9 |
# File 'lib/apple_music/album/attributes.rb', line 7 def track_count @track_count end |
#upc ⇒ Object (readonly)
Returns the value of attribute upc.
7 8 9 |
# File 'lib/apple_music/album/attributes.rb', line 7 def upc @upc end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
7 8 9 |
# File 'lib/apple_music/album/attributes.rb', line 7 def url @url end |
Instance Method Details
#complete? ⇒ Boolean
36 37 38 |
# File 'lib/apple_music/album/attributes.rb', line 36 def complete? is_complete end |
#mastered_for_itunes? ⇒ Boolean
44 45 46 |
# File 'lib/apple_music/album/attributes.rb', line 44 def mastered_for_itunes? is_mastered_for_itunes end |
#single? ⇒ Boolean
40 41 42 |
# File 'lib/apple_music/album/attributes.rb', line 40 def single? is_single end |