Sha256: 8577ff9d19a4c3438d5e65ff7cd0e325f4e42c6bd3ea99a0ce153b620411a5f7

Contents?: true

Size: 1.09 KB

Versions: 10

Compression:

Stored size: 1.09 KB

Contents

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
  end
  
  def self.included(klass)
    klass.extend ClassMethods
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
wizardwerdna-pokerstats-0.4.0 lib/pokerstats/hand_statistics_api.rb
wizardwerdna-pokerstats-0.5.0 lib/pokerstats/hand_statistics_api.rb
wizardwerdna-pokerstats-0.6.0 lib/pokerstats/hand_statistics_api.rb
wizardwerdna-pokerstats-0.7.0 lib/pokerstats/hand_statistics_api.rb
wizardwerdna-pokerstats-0.8.0 lib/pokerstats/hand_statistics_api.rb
wizardwerdna-pokerstats-0.8.1 lib/pokerstats/hand_statistics_api.rb
wizardwerdna-pokerstats-0.8.2 lib/pokerstats/hand_statistics_api.rb
wizardwerdna-pokerstats-0.9.0 lib/pokerstats/hand_statistics_api.rb
wizardwerdna-pokerstats-1.0.0 lib/pokerstats/hand_statistics_api.rb
wizardwerdna-pokerstats-1.0.2 lib/pokerstats/hand_statistics_api.rb