Class: AteTracks::Structures::Track
- Inherits:
-
Object
- Object
- AteTracks::Structures::Track
- Defined in:
- lib/atetracks/structures.rb
Instance Attribute Summary collapse
-
#artist_details ⇒ Object
Returns the value of attribute artist_details.
-
#buy_icon ⇒ Object
Returns the value of attribute buy_icon.
-
#buy_link ⇒ Object
Returns the value of attribute buy_link.
-
#buy_text ⇒ Object
Returns the value of attribute buy_text.
-
#full_length ⇒ Object
Returns the value of attribute full_length.
-
#id ⇒ Object
Returns the value of attribute id.
-
#media_type ⇒ Object
Returns the value of attribute media_type.
-
#name ⇒ Object
Returns the value of attribute name.
-
#performer ⇒ Object
Returns the value of attribute performer.
-
#release_name ⇒ Object
Returns the value of attribute release_name.
-
#report_delay_s ⇒ Object
Returns the value of attribute report_delay_s.
-
#stream_source ⇒ Object
Returns the value of attribute stream_source.
-
#track_annotation ⇒ Object
Returns the value of attribute track_annotation.
-
#track_file_stream_url ⇒ Object
Returns the value of attribute track_file_stream_url.
-
#uid ⇒ Object
Returns the value of attribute uid.
-
#url ⇒ Object
Returns the value of attribute url.
-
#user_id ⇒ Object
Returns the value of attribute user_id.
-
#year ⇒ Object
Returns the value of attribute year.
Instance Method Summary collapse
-
#initialize(data) ⇒ Track
constructor
A new instance of Track.
Constructor Details
#initialize(data) ⇒ Track
Returns a new instance of Track.
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/atetracks/structures.rb', line 55 def initialize(data) return nil if data.nil? @track_annotation = data['track_annotation'] @artist_details = ArtistDetails.new(data['artist_details']) @buy_link = data['buy_link'] @buy_icon = data['buy_icon'] @buy_text = data['buy_text'] @track_file_stream_url = data['track_file_stream_url'] @stream_source = data['stream_source'] @user_id = data['user_id'] @full_length = data['full_length'] @id = data['id'] @name = data['name'] @performer = data['performer'] @release_name = data['release_name'] @url = data['url'] @year = data['year'] @uid = data['uid'] @report_delay_s = data['report_delay_s'] unless @track_file_stream_url.nil? @media_type = (@track_file_stream_url == 'upload_v3') ? 'm4a' : 'mp3' end end |
Instance Attribute Details
#artist_details ⇒ Object
Returns the value of attribute artist_details.
51 52 53 |
# File 'lib/atetracks/structures.rb', line 51 def artist_details @artist_details end |
#buy_icon ⇒ Object
Returns the value of attribute buy_icon.
51 52 53 |
# File 'lib/atetracks/structures.rb', line 51 def buy_icon @buy_icon end |
#buy_link ⇒ Object
Returns the value of attribute buy_link.
51 52 53 |
# File 'lib/atetracks/structures.rb', line 51 def buy_link @buy_link end |
#buy_text ⇒ Object
Returns the value of attribute buy_text.
51 52 53 |
# File 'lib/atetracks/structures.rb', line 51 def buy_text @buy_text end |
#full_length ⇒ Object
Returns the value of attribute full_length.
51 52 53 |
# File 'lib/atetracks/structures.rb', line 51 def full_length @full_length end |
#id ⇒ Object
Returns the value of attribute id.
51 52 53 |
# File 'lib/atetracks/structures.rb', line 51 def id @id end |
#media_type ⇒ Object
Returns the value of attribute media_type.
51 52 53 |
# File 'lib/atetracks/structures.rb', line 51 def media_type @media_type end |
#name ⇒ Object
Returns the value of attribute name.
51 52 53 |
# File 'lib/atetracks/structures.rb', line 51 def name @name end |
#performer ⇒ Object
Returns the value of attribute performer.
51 52 53 |
# File 'lib/atetracks/structures.rb', line 51 def performer @performer end |
#release_name ⇒ Object
Returns the value of attribute release_name.
51 52 53 |
# File 'lib/atetracks/structures.rb', line 51 def release_name @release_name end |
#report_delay_s ⇒ Object
Returns the value of attribute report_delay_s.
51 52 53 |
# File 'lib/atetracks/structures.rb', line 51 def report_delay_s @report_delay_s end |
#stream_source ⇒ Object
Returns the value of attribute stream_source.
51 52 53 |
# File 'lib/atetracks/structures.rb', line 51 def stream_source @stream_source end |
#track_annotation ⇒ Object
Returns the value of attribute track_annotation.
51 52 53 |
# File 'lib/atetracks/structures.rb', line 51 def track_annotation @track_annotation end |
#track_file_stream_url ⇒ Object
Returns the value of attribute track_file_stream_url.
51 52 53 |
# File 'lib/atetracks/structures.rb', line 51 def track_file_stream_url @track_file_stream_url end |
#uid ⇒ Object
Returns the value of attribute uid.
51 52 53 |
# File 'lib/atetracks/structures.rb', line 51 def uid @uid end |
#url ⇒ Object
Returns the value of attribute url.
51 52 53 |
# File 'lib/atetracks/structures.rb', line 51 def url @url end |
#user_id ⇒ Object
Returns the value of attribute user_id.
51 52 53 |
# File 'lib/atetracks/structures.rb', line 51 def user_id @user_id end |
#year ⇒ Object
Returns the value of attribute year.
51 52 53 |
# File 'lib/atetracks/structures.rb', line 51 def year @year end |