Sha256: db74cbbc6ab7c6a843921886f5c502058cd56f886b96c938f2224a3c1e0b4413

Contents?: true

Size: 1.39 KB

Versions: 20

Compression:

Stored size: 1.39 KB

Contents

module Pokerstats
  module HandStatisticsAPI
    def initialize handstatistics
      @hand_statistics = handstatistics
    end

    def self.exposed_methods
      self.public_instance_methods - StatisticsHolder.public_instance_methods
    end

    def report screen_name
      automatic_report screen_name
    end

    def register_player screen_name, street
    end

    def street_transition street
    end

    def street_transition_for_player street, player
    end

    def apply_action action, street
    end
  
    def automatic_report screen_name
      result = {}
      self.class.report_specification.each do |each|
        result[each[0]] = send(each[2], screen_name)
      end
      result
    end
    
    private
  
    module ClassMethods
      def report_specification
        [
          # [key,   sql_type,   function]
        ]
      end
  
      def rails_migration_segment_for_player_data
        prefix = "\n" + " " * 10
        result = "#{prefix}# FROM #{self.to_s}"
        report_specification.each do |each|
          result += "#{prefix}t.#{each[1]}\t#{each[0].inspect}"
        end
        result += "\n"
      end
    
      def rails_generator_command_line_for_player_data
        report_specification.inject("") do |string, each|
          string + "#{each[0]}:#{each[1]} " 
        end
      end
    end
    
    def self.included(klass)
      klass.extend ClassMethods
    end
  end
end

Version data entries

20 entries across 20 versions & 2 rubygems

Version Path
wizardwerdna-pokerstats-1.0.15 lib/pokerstats/hand_statistics_api.rb
wizardwerdna-pokerstats-1.0.16 lib/pokerstats/hand_statistics_api.rb
wizardwerdna-pokerstats-1.0.17 lib/pokerstats/hand_statistics_api.rb
wizardwerdna-pokerstats-1.0.18 lib/pokerstats/hand_statistics_api.rb
wizardwerdna-pokerstats-1.0.19 lib/pokerstats/hand_statistics_api.rb
wizardwerdna-pokerstats-1.0.22 lib/pokerstats/hand_statistics_api.rb
wizardwerdna-pokerstats-2.0.0 lib/pokerstats/hand_statistics_api.rb
pokerstats-2.0.13 lib/pokerstats/hand_statistics_api.rb
pokerstats-2.0.12 lib/pokerstats/hand_statistics_api.rb
pokerstats-2.0.11 lib/pokerstats/hand_statistics_api.rb
pokerstats-2.0.10 lib/pokerstats/hand_statistics_api.rb
pokerstats-2.0.9 lib/pokerstats/hand_statistics_api.rb
pokerstats-2.0.8 lib/pokerstats/hand_statistics_api.rb
pokerstats-2.0.7 lib/pokerstats/hand_statistics_api.rb
pokerstats-2.0.6 lib/pokerstats/hand_statistics_api.rb
pokerstats-2.0.5 lib/pokerstats/hand_statistics_api.rb
pokerstats-2.0.4 lib/pokerstats/hand_statistics_api.rb
pokerstats-2.0.3 lib/pokerstats/hand_statistics_api.rb
pokerstats-2.0.2 lib/pokerstats/hand_statistics_api.rb
pokerstats-2.0.1 lib/pokerstats/hand_statistics_api.rb