Class: AppleMusic::Preview

Inherits:
Resource show all
Defined in:
lib/apple_music/preview.rb

Overview

Constant Summary

Constants inherited from Resource

Resource::RESOURCE_MAP

Instance Attribute Summary collapse

Attributes inherited from Resource

#attributes, #href, #id, #relationships, #type

Instance Method Summary collapse

Methods inherited from Resource

build

Constructor Details

#initialize(props = {}) ⇒ Preview

Returns a new instance of Preview.



8
9
10
11
# File 'lib/apple_music/preview.rb', line 8

def initialize(props = {})
  @artwork = Artwork.new(props['artwork']) if props['artwork']
  @url = props['url'] # required
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class AppleMusic::Resource

Instance Attribute Details

#artworkObject (readonly)

Returns the value of attribute artwork.



6
7
8
# File 'lib/apple_music/preview.rb', line 6

def artwork
  @artwork
end

#urlObject (readonly)

Returns the value of attribute url.



6
7
8
# File 'lib/apple_music/preview.rb', line 6

def url
  @url
end