Sha256: a1f74a32450c5eeac28771343c32f04b331236e98796dfe3b3cd7579d9ecda03

Contents?: true

Size: 666 Bytes

Versions: 10

Compression:

Stored size: 666 Bytes

Contents

require_relative "../collection.rb"
require_relative "../metric.rb"

module PlaylyfeClient
  module V2
    class MetricCollection < PlaylyfeClient::V2::Collection
     
      def find(str)
        (@items.detect {|pl| pl.name == str || pl.id == str})
      end  
      
      private

        def initialize(game)  
          super
          @items=[]
          fill_items(game.connection.get_full_metrics_array)
        end
        
        def fill_items(hash_array)  
          hash_array.each do |action_hash|
            @items << PlaylyfeClient::V2::Metric.create_from(action_hash, @game)
          end  
        end  

         
    end  
  end
end    
     

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
playlyfe_client-1.1.6 lib/playlyfe_client/v2/collection/metric_collection.rb
playlyfe_client-1.1.5 lib/playlyfe_client/v2/collection/metric_collection.rb
playlyfe_client-1.1.3 lib/playlyfe_client/v2/collection/metric_collection.rb
playlyfe_client-1.1.2 lib/playlyfe_client/v2/collection/metric_collection.rb
playlyfe_client-1.1.1 lib/playlyfe_client/v2/collection/metric_collection.rb
playlyfe_client-1.1.0 lib/playlyfe_client/v2/collection/metric_collection.rb
playlyfe_client-1.0.6 lib/playlyfe_client/v2/collection/metric_collection.rb
playlyfe_client-1.0.5 lib/playlyfe_client/v2/collection/metric_collection.rb
playlyfe_client-1.0.4 lib/playlyfe_client/v2/collection/metric_collection.rb
playlyfe_client-1.0.2 lib/playlyfe_client/v2/collection/metric_collection.rb