The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
Patches to make DataSet shiny

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Gregory Brown

Posts: 172
Nickname: greg7224
Registered: Nov, 2005

Gregory Brown is the author of Ruby Reports (ruport)
Patches to make DataSet shiny Posted: Jun 6, 2006 4:14 PM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Gregory Brown.
Original Post: Patches to make DataSet shiny
Feed Title: Ruby Reports Blog
Feed URL: http://www.cwinters.com/blog/index.rss
Feed Description: News and Updates regarding the Ruby Reports library and toolset.
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Gregory Brown
Latest Posts From Ruby Reports Blog

Advertisement

Dudley is kicking ass today! Two Three new patches commited to SVN

1
Here's a patch that changes the dataset constructor to  
accept :content and :default keywords. Also, DataSet right now has  
two different implementations of clone(). I'm pretty sure one of them  
needs to go away.

-d
2
Here's a patch to allow DataSet#<< to do the right thing when  
appending another DataSet, or a DataRow, or an array of DataRows. It  
only works if the sets have the same fields. We should probably  
figure out a coherent semantics for comparing DataSets and DataRows  
so we can do set unions and intersections and stuff like that in a  
way that makes sense, but I'm still not quite sure how that should  
work. Oh, and there's a little DataSet#to_a in there that just calls  
to_a on the set's @data, too.

-d
3
Okay, this is the last one for today (I think :-) ). It's an
implementation of the basic set operations (union, intersection, and
difference) for DataSets. It also adds + as an alias to concat for
smooshing two similar DataSets together.

-d

Example of the set operations stuff

>> ([ [1,2],[3,4] ].to_ds(%w[a b]) & [ [3,4] , [1,2], [5,6] ].to_ds(%w[a b])).as(:csv)
=> "a,b\n1,2\n3,4\n"
>> ([ [1,2],[3,4] ].to_ds(%w[a b]) | [ [3,4], [1,2], [5,6] ].to_ds(%w[a b])).as(:csv) => "a,b\n1,2\n3,4\n5,6\n"

Read: Patches to make DataSet shiny

Topic: Linux Journal Julio 2006: Heinemeier, Ruby y Rails Previous Topic   Next Topic Topic: Mosquito & Decamp

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use