Class: NBS::ArtistProfile
- Inherits:
-
Object
- Object
- NBS::ArtistProfile
- Defined in:
- lib/next-big-sound/artist_profile.rb
Constant Summary collapse
- METRICS =
%w(plays fans views comments downloads likes price)
Instance Attribute Summary collapse
-
#artist_id ⇒ Object
Returns the value of attribute artist_id.
-
#options ⇒ Object
Returns the value of attribute options.
-
#service_type ⇒ Object
Returns the value of attribute service_type.
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(artist_id, service_type, url = "", options = {}) ⇒ ArtistProfile
constructor
A new instance of ArtistProfile.
- #load_metrics(sdate, edate) ⇒ Object
- #metrics(sdate, edate) ⇒ Object
- #set_metrics(metrics_array = {}) ⇒ Object
Constructor Details
#initialize(artist_id, service_type, url = "", options = {}) ⇒ ArtistProfile
Returns a new instance of ArtistProfile.
8 9 10 11 12 |
# File 'lib/next-big-sound/artist_profile.rb', line 8 def initialize(artist_id,service_type, url="",={}) self.service_type = service_type self.artist_id = artist_id self.url = url end |
Instance Attribute Details
#artist_id ⇒ Object
Returns the value of attribute artist_id.
6 7 8 |
# File 'lib/next-big-sound/artist_profile.rb', line 6 def artist_id @artist_id end |
#options ⇒ Object
Returns the value of attribute options.
6 7 8 |
# File 'lib/next-big-sound/artist_profile.rb', line 6 def @options end |
#service_type ⇒ Object
Returns the value of attribute service_type.
6 7 8 |
# File 'lib/next-big-sound/artist_profile.rb', line 6 def service_type @service_type end |
#url ⇒ Object
Returns the value of attribute url.
6 7 8 |
# File 'lib/next-big-sound/artist_profile.rb', line 6 def url @url end |
Instance Method Details
#load_metrics(sdate, edate) ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/next-big-sound/artist_profile.rb', line 19 def load_metrics(sdate,edate) metrics ={} METRICS.each do |metric_string| metrics[metric_string.to_s] = NBS::Metric.new(self.artist_id,self.service_type,metric_string.to_s,sdate,edate) end return metrics end |
#metrics(sdate, edate) ⇒ Object
13 14 15 |
# File 'lib/next-big-sound/artist_profile.rb', line 13 def metrics(sdate,edate) @metrics ||= load_metrics(sdate,edate) end |
#set_metrics(metrics_array = {}) ⇒ Object
16 17 18 |
# File 'lib/next-big-sound/artist_profile.rb', line 16 def set_metrics(metrics_array={}) @metrics = metrics_array end |