Sha256: e3aa31c2b6fb1453eb4df70a0d42666ddef81cd5f8c7f2e46616f0e07a84d88a

Contents?: true

Size: 781 Bytes

Versions: 4

Compression:

Stored size: 781 Bytes

Contents

module NBS

  class ArtistProfile
     METRICS = %w(plays fans views comments downloads likes price)

      attr_accessor :service_type,:url, :artist_id, :options

      def initialize(artist_id,service_type, url="",options={})
        self.service_type = service_type 
        self.artist_id = artist_id 
        self.url = url
      end
      def metrics(sdate,edate)
        @metrics ||= load_metrics(sdate,edate)
      end
      def set_metrics(metrics_array={})
        @metrics = metrics_array
      end
      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
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
next-big-sound-0.8.2 lib/next-big-sound/artist_profile.rb
next-big-sound-0.8.1 lib/next-big-sound/artist_profile.rb
next-big-sound-0.8.0 lib/next-big-sound/artist_profile.rb
next-big-sound-0.7.0 lib/next-big-sound/artist_profile.rb