Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
git-svn-id: http://stonecode.svnrepository.com/svn/ruport/trunk@296 bb2e8eb0-7117-0410-aac4-c024b40ed5f7
- Loading branch information
sandal
committed
Oct 21, 2006
1 parent
6144702
commit 0100532
Showing
9 changed files
with
44 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
%w[taggable record collection table set groupable ].each { |l| require "ruport/data/#{l}" } | ||
%w[groupable taggable record collection table set].each { |l| require "ruport/data/#{l}" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,17 @@ | ||
module Ruport::Data | ||
module Groupable | ||
|
||
def group_by_tag | ||
r_tags = data.map {|row| row.tags}.flatten.uniq | ||
d = r_tags.map do |t| | ||
select {|row| row.tags.include? t }.to_table(column_names) | ||
select {|row| row.tags.include? t }.to_table(column_names) | ||
end | ||
Record.new d, :attributes => r_tags | ||
end | ||
|
||
def create_tag_group(label,&block) | ||
select(&block).each { |r| r.tag label } | ||
end | ||
|
||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters