Class: AteTracks::Structures::Track

Inherits:
Object
  • Object
show all
Defined in:
lib/atetracks/structures.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_detailsObject

Returns the value of attribute artist_details.



51
52
53
# File 'lib/atetracks/structures.rb', line 51

def artist_details
  @artist_details
end

#buy_iconObject

Returns the value of attribute buy_icon.



51
52
53
# File 'lib/atetracks/structures.rb', line 51

def buy_icon
  @buy_icon
end

Returns the value of attribute buy_link.



51
52
53
# File 'lib/atetracks/structures.rb', line 51

def buy_link
  @buy_link
end

#buy_textObject

Returns the value of attribute buy_text.



51
52
53
# File 'lib/atetracks/structures.rb', line 51

def buy_text
  @buy_text
end

#full_lengthObject

Returns the value of attribute full_length.



51
52
53
# File 'lib/atetracks/structures.rb', line 51

def full_length
  @full_length
end

#idObject

Returns the value of attribute id.



51
52
53
# File 'lib/atetracks/structures.rb', line 51

def id
  @id
end

#media_typeObject

Returns the value of attribute media_type.



51
52
53
# File 'lib/atetracks/structures.rb', line 51

def media_type
  @media_type
end

#nameObject

Returns the value of attribute name.



51
52
53
# File 'lib/atetracks/structures.rb', line 51

def name
  @name
end

#performerObject

Returns the value of attribute performer.



51
52
53
# File 'lib/atetracks/structures.rb', line 51

def performer
  @performer
end

#release_nameObject

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_sObject

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_sourceObject

Returns the value of attribute stream_source.



51
52
53
# File 'lib/atetracks/structures.rb', line 51

def stream_source
  @stream_source
end

#track_annotationObject

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_urlObject

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

#uidObject

Returns the value of attribute uid.



51
52
53
# File 'lib/atetracks/structures.rb', line 51

def uid
  @uid
end

#urlObject

Returns the value of attribute url.



51
52
53
# File 'lib/atetracks/structures.rb', line 51

def url
  @url
end

#user_idObject

Returns the value of attribute user_id.



51
52
53
# File 'lib/atetracks/structures.rb', line 51

def user_id
  @user_id
end

#yearObject

Returns the value of attribute year.



51
52
53
# File 'lib/atetracks/structures.rb', line 51

def year
  @year
end