RubyGems Navigation menu

crosstab 0.1.0

FEATURES: * Input your data as an array of hashes * Input a report layout, built using a Ruby DSL * Outputs ASCII pivot tables suitable for fast reports * Pretty fast: takes less than a second to process 1,000 records of data by a report with 100 rows and 10 columns. == SYNOPSIS: require ‘crosstab’ data = [{:gender => "M", :age => 1}, {:gender => "F", :age => 2}, {:gender => "M", :age => 3}] my_crosstab = crosstab data do table do title "Q.A Gender:" row "Male", :gender => "M" row "Female", :gender => "F" end table do title "Q.B Age:" group "18 - 54" do row "18 - 34", :age => 1 row "35 - 54", :age => 2 end row "55 or older", :age => 3 end banner do column "Total" group "Gender" do column "Male", :gender => "M" column "Female", :gender => "F" end end end puts my_crosstab.to_s == REPORT: # puts my_crosstab.to_s Table 1 Q.A Gender: Gender —————- Total Male Female (A) (B) © ——- ——- ——- (BASE) 3 2 1 Male 2 2 – 67% 100% Female 1 – 1 33% 100% ———————————————————————— Table 2 Q.B Age: Gender —————- Total Male Female (A) (B) © ——- ——- ——- (BASE) 3 2 1 18 - 54 2 1 1 —————————– 67% 50% 100% 18 - 34 1 1 – 33% 50% 35 - 54 1 – 1 33% 100% 55 or older 1 1 – 33% 50%

Gemfile:
= Copy to clipboard Copied!

install:
=

Versions:

  1. 0.1.2 - October 19, 2007* (15 KB)
  2. 0.1.1 - October 18, 2007* (15 KB)
  3. 0.1.0 - October 18, 2007* (15 KB)

Runtime Dependencies (1):

hoe >= 1.2.1

Owners:

Authors:

  • Ryan Davis

SHA 256 checksum:

0a639ef8c97aae151d046fae9ffe3c66108d57a75732bdb628bd4a16f4924447

Total downloads 13,447

For this version 4,130

Licenses:

N/A

Required Ruby Version: > 0.0.0

Links: