How to return entire row to compare against another row in ruby

New to Ruby and would like to the following in Ruby

Read row
save the entire row (maybe zip it).

process.....

Receive user changes.

reread the row for update
compare the row to the saved row for changes
if no changes update the row
if changes error message to user, info has changed.

Thanks for your help

Bryan Webb

Not sure I understand the question. A "row" of what? Database table date, chess board pieces, pixels, or something else?

Also, what have you tried? Where are you running into difficulties?

James Edward Gray II

···

On Jul 1, 2005, at 3:25 PM, bww00amdahl@yahoo.com wrote:

New to Ruby and would like to the following in Ruby

Read row
save the entire row (maybe zip it).

process.....

Receive user changes.

reread the row for update
compare the row to the saved row for changes
if no changes update the row
if changes error message to user, info has changed.

Thanks for your help

Yes, database row.
just starting on design.

Thanks

Yes, database row.
just starting on design.

Thanks

You still haven't asked a question, that I can see. Are you asking me to write it for you, or is there some problem you need help with?

James Edward Gray II

···

On Jul 1, 2005, at 10:55 PM, bww00amdahl@yahoo.com wrote:

Yes, database row.
just starting on design.

bww00amdahl@yahoo.com wrote:

Yes, database row.
just starting on design.

Thanks

There are lots of database APIs for Ruby out there. Are you looking for some links?

As far as serialization goes, there's a Marshal class in the Ruby stdlibs, but you're welcome to implement your own. You could also write to YAML, or use a lib like AMarshal to store the Ruby object itself:

http://redhanded.hobix.com/inspect/serializingToRubyCode.html

I just googled for "Ruby marshal" to find that. Looks pretty neat.

Devin
Light a fire for a man, and he's warm for the night.
Set a man on fire, and he's warm for the rest of his life.

Thanks,
I have done this in other languages and was looking for some direction,
or if it had been done in ruby before , the ruby code.

Bryan

Well, you should probably examine the DBI for the database work. Comparing rows is a trivial programming task. You mentioned user input, I think a library like HighLine makes that a lot easier.

Hope that gets you going. Feel free to ask questions if you get stuck...

James Edward Gray II

···

On Jul 3, 2005, at 8:35 PM, bww00amdahl@yahoo.com wrote:

Thanks,
I have done this in other languages and was looking for some direction,
or if it had been done in ruby before , the ruby code.